[Clam-devel] Sampling Rate and AudioWriters

David García Garzón dgarcia at iua.upf.edu
Sun Apr 15 01:55:57 PDT 2007

AudioFile refactoring is a little tricker on AudioWriters as they require 
header information. Most of the information could be defaulted either on the 
configuration or just hidden from the user (format can be selected by the 
filename extension, encoding parameters can be set to the default ones...)
The only thing i found to be delicate is the samplerate.

Currently, on the places where we use it (except the tests), we are always 
saving at 44100 (sometimes a buggy solution) or taking the sample rate by 
hand from the peer reader.

The ideal setting is getting it from the incomming audio, but on current 
AudioFile design you must set the sampling rate before getting any data. And 
we all know that we still have no parameters propagation. So you should set 
it by hand to some quantity either hardcoded or configurable. The effect is 
that if the audio and the filewriter sampling rate does not match the save 
audio gets a different pitch. So if we keep it configurable the user would 
expect that whatever it comes into a writer a samplerate conversion is 

Of course the ideal setting is that all is sample rate safe, but it must be 
done. So, by now i'll keep it configurable, default to 44100 and without rate 
conversion. But do you have any thoughts on the matter?

David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
(Home) vokimon at telefonica adot net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20070415/d195c9bf/attachment-0003.pgp>

More information about the clam-devel mailing list