re: Playing Audio Backwards
re: Playing Audio Backwards
- Subject: re: Playing Audio Backwards
- From: Justin Carlson <email@hidden>
- Date: Thu, 25 Sep 2008 22:06:15 -0500
I'm working on a game for the iPhone and I need to be able to record audio and play it back in reverse.
I have implemented recording and normal playback using the sample SpeakEasy app:
So it's recording in a Linear-PCM format and what I get is a .caf file.
I've been doing some reading and from what I can tell it's not not possible to play sound backwards in real-time, but if I can re-write the file with the audio backwards, that would work fine, too.
The problem is that I have no idea how to do either or where I need to be looking to figure it out.
Hi Jason,
Well, nothing to do with iPh*n* as far as I know (unless some audio API has been omitted -- I am not a member of that program). AFAIR, AudioFile.h and ExtendedAudioFile.h should provide you with what you need to read or write a caf and access its streams/channels. Basically, you want to read each channel/stream backwards, so, if you don't need properties of the audio file it is pretty straightforward once you have a handle on that channel's data, assuming it is not in a compressed format. Considering the number of formats a caf can represent, this could take a few more lines of code than you're thinking. Once you have a handle on uncompressed data, it should be about as easy as reversing a string. Then you would of course replace the file's data with the reversed data, or you could just feed the audio output (or wherever you're sending the reversed signal) reading whatever stream you have backwards.
Spotlight 'ReverseOfflineUnit' on your system, this may help, though it is an AU example.
J |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden