Re: reading audiofile into floatbuffer
Re: reading audiofile into floatbuffer
- Subject: Re: reading audiofile into floatbuffer
- From: Philippe Wicker <email@hidden>
- Date: Wed, 14 Jan 2004 02:25:27 +0100
On Tuesday, January 13, 2004, at 09:22 PM, stiwi wrote:
Hi,
i want to read a audio-file from disk into a float buffer to use it as
a wavetable in my Audio-unit. I am trying to use the AudioFile API but
i am stuck with the AudioConverter. I can read my sound data with
AudioFileOpen and get some information about it with
AudioFileGetProperty, copy the raw data to RAM with
AudioFileReadPackets but after that i am lost. I can't figure out how
to convert and copy the data to a float buffer.
Any insight, hints, source-code, links, etc. most welcome.
Have a look at:
http://www.mat.ucsb.edu:8000/CoreAudio/90
You will find there a tutorial - posted by Robert Grant - about how to
write an AIF file using the AudioConverter to make the conversion
between the canonical format (Float32 pcm non interleaved) to 16 bits
pcm interleaved. You need to convert the oher way, but your code will
be basically the same (just swap the stream format descriptions).
You may also download the CoreAudio sample PlayAudioFileLight:
http://developer.apple.com/samplecode/Sample_Code/Core_Audio/
PlayAudioFileLite.htm
This simple sample demonstrates almost exactly what you need.
Thanks,
stiwi
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
Philippe Wicker
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.