Float sample format
Hi all!
What are the sample value ranges used when having sample format float(le) or double(le)?
When playing, the sound is loudest when using the whole range the type offers. When recording it seems the values are in range [-1,1]. Is that correct?
thanks in advance!
Viele Gruesse / best regards
Nicolas Hueppelshaeuser
--
nicolas hueppelshaeuser, emlix gmbh, http://www.emlix.com,
mailto:[email protected]
fon +49 551 30664 -0, fax -11, bahnhofsallee 1b, 37081 göttingen, germany
emlix - your embedded linux partner
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
Quoted 2 lines · Nicolas Hüppelshäuser
What are the sample value ranges used when having sample format float(le) or double(le)?
Between -1 and 1. (LE/BE doesn't make any difference.)
Quoted 1 line
When playing, the sound is loudest when using the whole range the type offers.
Really? What sound card lets you play inifinitely loud samples? :-)
HTH
Clemens
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
Quoted 10 lines · Clemens Ladisch
Quoted 2 lines · Nicolas Hüppelshäuser
What are the sample value ranges used when having sample format float(le) or double(le)?
Between -1 and 1. (LE/BE doesn't make any difference.)
Quoted 2 lines
When playing, the sound is loudest when using the whole range the type offers.
Really? What sound card lets you play inifinitely loud samples? :-)
;-) Well, in fact for playback I use [FLT_MIN,FLT_MAX] and it turned out to be louder than [-1,1] on the Duo USB Audiosport (and in fact when playing the first time I had to pull down my ear-phones - that means the sound is approximatly infinitely loud).
Viele Gruesse / best regards
Nicolas Hueppelshaeuser
--
nicolas hueppelshaeuser, emlix gmbh, http://www.emlix.com,
mailto:[email protected]
fon +49 551 30664 -0, fax -11, bahnhofsallee 1b, 37081 göttingen, germany
emlix - your embedded linux partner
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
Quoted 9 lines · Nicolas Hüppelshäuser
Quoted 5 lines · Clemens Ladisch
Quoted 2 lines · Nicolas Hüppelshäuser
When playing, the sound is loudest when using the whole range the type offers.
Really? What sound card lets you play inifinitely loud samples? :-)
;-) Well, in fact for playback I use [FLT_MIN,FLT_MAX] and it turned out to be louder than [-1,1]
The float->linear conversion code clips at -1/1 (search for GET32F_END in alsa-lib/src/pcm/plugin_ops.h), so what you got what a case of extreme compression. No doubt this _is_ louder. :)
Best regards,
Clemens
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
Am Freitag, 5. November 2004 09:37 schrieb Clemens Ladisch:
Quoted 6 lines
Quoted 5 lines · Nicolas Hüppelshäuser
Quoted 4 lines · Clemens Ladisch
Quoted 2 lines · Nicolas Hüppelshäuser
When playing, the sound is loudest when using the whole range the type offers.
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
Really? What sound card lets you play inifinitely loud samples? :-)
;-) Well, in fact for playback I use [FLT_MIN,FLT_MAX] and it turned out to be louder than [-1,1]
The
float->linearconversion code clips at -1/1 (search forGET32F_ENDinalsa-lib/src/pcm/plugin_ops.h), so what you got what a case of extreme compression. No doubt this _is_ louder. :)
If you can do, generate a sine with 80Hz this should be a pure low tone when amplitude is low. If you can't hear it use 160Hz instead.
(The equipment/stereo should be on low volume to make sure nothing is harmed.) Until you reach the +-1 in amplitude it should only get a bit louder but no changes should happen. When you excess it it gets interesting:
a) The limit is above of +-1 and it still dosen't get distorted.
b) Clipping occurs. You hear some distortion, getting bigger the bigger the volume is. It appears to get louder but this is because of human perception.
c) Overflow occurs +1.1 gets mapped to -0.9. Your ears will fall off.
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
Quoted 6 lines · Nicolas Hüppelshäuser
Hi all!
What are the sample value ranges used when having sample format float(le) or double(le)?
When playing, the sound is loudest when using the whole range the type offers.
Of course, if you gain the samples, then you'll get louder output but not in full dynamic range.
Quoted 1 line
When recording it seems the values are in range [-1,1]. Is that correct?
Yep:
/** Float 32 bit Little Endian, Range -1.0 to 1.0 */
SND_PCM_FORMAT_FLOAT_LE,
/** Float 32 bit Big Endian, Range -1.0 to 1.0 */
SND_PCM_FORMAT_FLOAT_BE,
/** Float 64 bit Little Endian, Range -1.0 to 1.0 */
SND_PCM_FORMAT_FLOAT64_LE,
/** Float 64 bit Big Endian, Range -1.0 to 1.0 */
SND_PCM_FORMAT_FLOAT64_BE,
Jaroslav-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click