In my application I have the bytes of an audio file stored in NSMutableData like so:
NSMutableData *data = [NSMutableData dataWithBytes:byteData length:len];
I can then later play this using
player = [[AVAudioPlayer alloc] initWithData:data error:&error];
My question is what code would reverse the bytes in the data object, so that when played the sound is backwards?
Any help is very much appreciated.
By the way, the byteData of the audio is obtained using:
NSMutableData *wave =[NSMutableData dataWithContentsOfURL:url];
NSUInteger len = [wave length];
Byte *byteData = (Byte*)malloc(len);
memcpy(byteData, [wave bytes], len);