Apr 30, 2006 at 3:53am
I am trying to write audio files (.aif) from an msp external i am working on.
I am wondering where I am going wrong. Do I not have to write .aiff header information before writing my data or is this
Here is a snippet of my code:
// create file name to save .aif file as
// First: Create File
// Second: Write File
// Third: Close File
Apr 30, 2006 at 7:41am
I’m pretty sure that creating the file as AIFF just tells the OS that the file should be treated as an AIFF file (regardless of whether the data is valid). Looking at your code you’ll have a RAW 32-bit floating point audio file.
You need to write the data into the file according to the AIFF spec. So yes you’d need to write header data and audio data as AIFF “chunks”. You’d probably need to convert the floating point format to 8, 16, 24 or 32 bit signed ints too, I’m fairly sure AIFF doesn’t support float.
I found this which might be helpful:
May 1, 2006 at 2:42am
Yah, Bourke’s AIFF tutorial is ver helpful.
I will relook at my code and try and write header data.
Thanks for the info.
You must be logged in to reply to this topic.