[mythtv] Re: Audio handling classes [WAS: [PATCH] MythPhone ...]

Ed Wildgoose lists at wildgooses.com
Thu Jan 27 07:06:01 EST 2005


Jeremiah Morris wrote:

> On 26 Jan 2005, at 5:02 PM, Ed Wildgoose wrote:
>
>> Having synchronised in and out audio will be essential if we ever 
>> want to support accoustic echo cancellation.
>
>
> That would be very cool. I'd also love to have dynamic volume control, 
> based on ambient noise. With pause and commercial skip taken care of, 
> now our biggest TV annoyance is having to crank the volume when we're 
> making dinner and running the faucet, boiling water, and so on. The 
> algorithm's a lot simpler too, so it could be a guinea pig for the 
> audio input in case you run into snags on the echo cancellation. (I'm 
> almost positive I'd be of no help there, though I'd be glad to pitch 
> in on the other parts.)


This is fairly straightforward.  Have a look at the mplayer code for an 
example.  There is probably the algorithm already in ffmpeg?

Basic algorithm is just to look at RMS of some small history of audio 
samples.  Change volume to bring this up to some preset level.  The 
trick is to do something sensible when the volume jumps up again (loud 
explosion or something).  Perhaps it's best to do soft clipping on the 
loud explosion and then slowly ramp down the volume...? Or perhaps it's 
better just to immediately cut the volume and build it up slowly again 
if needed...? 

Ed W


More information about the mythtv-dev mailing list