I want to play a sound like this:
#define url(x) [NSURL URLWithString:x]
....
AVAudioPlayer *myFatBeat;
myFatBeat = [[AVAudioPlayer alloc] initWithContentsOfURL:url(@"/Library/Ringtones/Bell% Tower.m4r") error:nil];
[myFatBeat setNumberOfLoops:-1];
[myFatBeat play];
but it fails. I think it’s due to the space between Belland Tower, as it works if the sound name is Àlarm. Then, I tried to escape the sound name like this Bell\ Tower, but I get error: unknown escape sequence: '\040' when compiling.
Any ideas ?
I forgot if this is how you do it in an
NSUrl, but you can try%20instead of the space.