-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing floating point samples to a wav file #46
Comments
The "Output Format" is the type of data saved in the file. To convert the input floating point data to 16 bit PCM, you need to specify a compression value of WAV_FORMAT_PCM (and set nbits to 16). Something like:
|
The error that you received:
is because no one has implemented support for half width (16 bit) floats. It should be possible now that Julia has support for the type. |
Thank you, that works. Coming from Matlab, I just assumed that if I passed Question: would it be interesting to automatically determine the compression scheme from
Though I just checked and it is also possible to use Am I missing something here? |
There is some code that implements part of your request. In practice, I find it a bit too subtle. Generally, I want to choose how the samples are encoded in the file. Despite the questionable usefulness, do you have an suggestions to make the feature easier to find? |
This is actually a question, not an issue...
I'm a bit confused about the second table in the
wavwrite
section of the documentation (the table about floating point values). What does the "Output Format" column of this table mean? For example, based on the second row of that table, I thought that if I passed a vector of doubles (y data) to thewavwrite
function with nbits=16, the function would convert the y data to 16 bit integers, mapping the y data range to the range -32768:32767 before writing the data to the output file. However, if I try to do that, I get the following error message:ERROR: 16 bits is not supported for WAVE_FORMAT_IEEE_FLOAT.
Of course I can do the conversion to Int16 myself before calling
wavwrite
, but in that case I don't know what the last column of the table means. Right after the table, one can read:"Floating point (single and double precision) values are written to the file unaltered. The library will not modify the data range or representation."
This suggests that I do have to do the conversion myself before calling
wavwrite
...The text was updated successfully, but these errors were encountered: