Rockbox Development > Feature Ideas
FS#10199 - Dynamic Range Compression
CCCMikey:
Just saw this post - since I read it before it was edited, I didn't get the reply notification - will go see if I can figure out how to install it now :)
Edit: n00b alert: This exceeds my knowledge. I assume the file is at http://www.rockbox.org/tracker/task/10199?getfile=20037 - which yields a text file starting with
--- Code: ---Index: apps/pcmbuf.c
===================================================================
--- apps/pcmbuf.c (revision 21841)
+++ apps/pcmbuf.c (working copy)
--- End code ---
I'm guessing this file doesn't go into RockBox utility, but is either copied to the device or is 'built' somehow? Feel free to ignore this post if I'm too far below a reasonable knowledge to proceed.
If you'd like an example of a loud 'n' quiet file that would test this, you could try http://mpegmedia.abc.net.au/local/sydney/200907/r397504_1862526.mp3
soap:
CCCMikey:
Flyspray contains (for the most part) Patches
nerdrunner:
As I said in another post, a really good way to implement this would be to utilize the _microphone_ to sample the background sound & adjust the volume & dynamic range compression to match this noise floor. This is an analogy to a program that you used to be able to get for the Palm Treo that utilized the Treo's builtin camera to sample the amount of ambient light & use this info to set the brightness & contrast on the Treo's display. Similar ideas are used in some TV's to adjust brightness & contrast.
Llorean:
Adjust volume based on background noise is just a recipe for hearing damage. Compression might make sense though.
nerdrunner:
Here's a high level description of how a microphone closed loop dynamic range compression system could work.
1. Implement a simple system to sample the microphone & compute a crude dB number for the ambient background noise.
2. Implement a system to compute the current dB number from the playing track; this should already be available from the VU meter.
3. Provide an exponential decay with a time constant sigma1 to filter the background noise.
4. Provide an exponential decay with a time constant sigma2 to filter the playing track.
5. Instead of using the volume control to set the absolute dB, utilize the volume control to set the _difference_ between the filtered playback dB and the filtered background noise dB.
6. Yes, different players, different earphones & different microphones will all affect these numbers, but you can utilize the "volume" control to provide enough headroom above the background noise to hear the podcast and/or music.
7. If your ears are getting blasted by the earphones with such an algorithm, then you should probably leave the environment, because the earphones are only a few dB ahead of the background dB. When I'm riding on the subway and/or riding my bike in traffic, the earphones may well have to kick up pretty loud to still be understandable.
8. The settings of sigma1 & sigma2 should be user controllable.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version