I just started using Instruments and its Leak detection feature. I was monitoring my code and I noticed there is a leak when I call the method:
AudioServicesCreateSystemSoundID
I am basically using the SoundEffect.m file from the Metronome sample code. I am using a soundfile that was originally a .wav and I converted it using Itunes to a aif and renamed it a caf. It plays just fine and it wasn't until I ran Instruments that I realized there was a leak.
The odd thing is that, when I use a different sound file (tick.caf - from Mentronome sample project) - there is no leak. The same issue is described here with no real answer as to why:
http://discussions.apple.com/thread.jspa?messageID=8360344
Anyways, is there any reason why my sound file would cause a leak? Is Audio Toolkit particularly picky about the audio file it is trying to play??
-
I don't see why it would cause a leak, but perhaps there is a bug in AudioServices when playing an
aifffile named ascaf. Try converting usingafconvertto produce a realcaffile from your mac:afconvert -f caff -d ima4 input.mp3 output.cafWillF : Yup that did it! Thanks! -
Use AudioServicesDisposeSystemSoundID to dispose.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.