W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2014

Re: Fading sound in and out

From: Chinmay Pendharkar <notthetup@gmail.com>
Date: Wed, 20 Aug 2014 22:43:30 +0800
Message-ID: <CAJw8Xiqqw6H_4eMZK2zL0H-VW4GP3O8PRGBsWH=LTNU-LBL2tw@mail.gmail.com>
To: Yehonathan Sharvit <viebel@gmail.com>
Cc: "public-audio@w3.org" <public-audio@w3.org>
Hello,

You can look at using the exponentialRampToValueAtTime or
setTargetAtTime methods
instead.

Human perception of loudness is logarithmic in nature, so exponential
decays of loudness feel 'smoother' to us than linear decays.

-Chinmay


On Wed, Aug 20, 2014 at 10:29 PM, Yehonathan Sharvit <viebel@gmail.com>
wrote:

> Hi,
>
>
> What is the best way to fade sound in and out?
>
> I tried to achieve that by calling linearRampToValueAtTime (see a demo:
> http://jsfiddle.net/viebel/9La05fg5/7/) on a gain node but the effect was
> not smooth enough?
>
> How could I make it smoother?
>
> Thanks,
> Yehonathan.
>
Received on Wednesday, 20 August 2014 14:44:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:14 UTC