[Stk] FileWvIn question

Stephen Sinclair stephen.sinclair@mail.mcgill.ca
Sun, 04 Feb 2007 12:21:42 -0500


It's probably one of 32768, 65536, or 2147483648 depending on your data 
type. (16-bit or 32-bit, signed unsigned, etc).

Unfortunately I think that through the FileWvIn interface there is no 
function to provide the data type.  However, I _think_ that if you 
specify to use normalization, and also to use "chunking" (that is, 
streaming from disk instead of loading the whole file), then it will 
"normalize", but without using the peak value.  In other words, the data 
stream will be multiplied by 1/32768 for example, isntead of scaling the 
largest data point to 1.  This is probably what you really want, since 
then the data type is not important, and your relative amplitude will be 
unaffected.  I haven't tested it, however..

Steve


greg kellum wrote:
> Hi,
>
> I have been trying to use the classes FileWvIn and FileWvOut to test 
> some signal processing code that I have been working on.  I have 
> noticed that by default FileWvIn normalizes the sound file.  So, if I 
> try to just make a copy of a sound file via FileWvIn and FileWvOut, 
> the resulting sound file is quite a bit louder than the source file.  
> If I however turn off the normalization, FileWvIn outputs values that 
> don't fall between -1 and 1 but are instead in the thousands.  These 
> values obviously need to be scaled by some factor to get useable audio 
> output.  So my question is: by what factor would these values have to 
> be scaled in order to make an identical copy of the original sound file?
>
> Thanks,
> Greg
>
> _________________________________________________________________
> Search for grocery stores. Find gratitude. Turn a simple search into 
> something more. 
> http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_gratitude&FORM=WLMTAG 
>
>
> _______________________________________________
> Stk mailing list
> Stk@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk