[Stk] FileWvIn question
greg kellum
greg_kellum@hotmail.com
Sun, 04 Feb 2007 23:35:14 +0000
Hi Stephen,
Thanks for the advice. I ended up multiplying the sample values by 1/32768
and got the result I was looking for.
I did first try the chunking approach you suggested. But I kept getting
some strange clipped sample values during the second chunk. I tried using
different chunk sizes and chunk thresholds to try to correct the problem,
but that usually caused the program to crash with a segmentation fault. I
have no idea why this chunking caused so many issues. Maybe, Gary could
take a look at it for a future release. But in any case I found a
work-around...
Best,
Greg
>From: Stephen Sinclair <stephen.sinclair@mail.mcgill.ca>
>To: greg kellum <greg_kellum@hotmail.com>
>CC: stk@ccrma.Stanford.EDU
>Subject: Re: [Stk] FileWvIn question
>Date: 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
>
>_______________________________________________
>Stk mailing list
>Stk@ccrma.stanford.edu
>http://ccrma-mail.stanford.edu/mailman/listinfo/stk
_________________________________________________________________
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