¡@

Home 

2014/10/15 ¤U¤È 10:14:19

iphone Programming Glossary: soundpath

AVAudioPlayer memory leak

http://stackoverflow.com/questions/5771799/avaudioplayer-memory-leak

the leak AVAudioPlayer NSAutoreleasePool audioDataspool NSAutoreleasePool alloc init pool is created NSString soundpath NSBundle mainBundle pathForResource @ cardwhoosh ofType @ mp3 NSData audioData NSData dataWithContentsOfFile soundpath autorelease.. soundpath NSBundle mainBundle pathForResource @ cardwhoosh ofType @ mp3 NSData audioData NSData dataWithContentsOfFile soundpath autorelease AVAudioPlayer player AVAudioPlayer alloc initWithData audioData error NULL soundpath nil soundpath release player.. soundpath autorelease AVAudioPlayer player AVAudioPlayer alloc initWithData audioData error NULL soundpath nil soundpath release player play play sound player nil player release player autorelease audioData nil audioData release..

Is it possible to play sounds without stopping iPod music?

http://stackoverflow.com/questions/11036748/is-it-possible-to-play-sounds-without-stopping-ipod-music

to play sounds within an app without stopping iPod music Right now I'm using the following but it stops iPod music soundPath NSBundle mainBundle pathForResource @ mySound ofType @ mp3 soundURL NSURL fileURLWithPath soundPath mySound AVAudioPlayer.. stops iPod music soundPath NSBundle mainBundle pathForResource @ mySound ofType @ mp3 soundURL NSURL fileURLWithPath soundPath mySound AVAudioPlayer alloc initWithContentsOfURL soundURL error nil mySound prepareToPlay and then mySound play iphone..

iPhone: get duration of an audio file

http://stackoverflow.com/questions/1246637/iphone-get-duration-of-an-audio-file

There's one property to get that should give you the estimated duration. Code NSURL afUrl NSURL fileURLWithPath soundPath AudioFileID fileID OSStatus result AudioFileOpenURL CFURLRef afUrl kAudioFileReadPermission 0 fileID UInt64 outDataSize..

AVAudioPlayer error loading file

http://stackoverflow.com/questions/7290418/avaudioplayer-error-loading-file

Security.framework Versions A Security Here is my code that should play a sound when my button is pressed NSString soundPath NSBundle mainBundle pathForResource @ tick ofType @ caf NSError error NSURL soundURL NSURL fileURLWithPath soundPath AVAudioPlayer.. soundPath NSBundle mainBundle pathForResource @ tick ofType @ caf NSError error NSURL soundURL NSURL fileURLWithPath soundPath AVAudioPlayer tickPlayer AVAudioPlayer alloc initWithContentsOfURL soundURL error error tickPlayer setDelegate self tickPlayer..

Sound not playing with AVAudioPlayer

http://stackoverflow.com/questions/9963230/sound-not-playing-with-avaudioplayer

BellViewController.h @interface BellViewController @end @implementation BellViewController IBAction pushBell NSString soundPath NSBundle mainBundle pathForResource @ bell1 ofType @ caf NSURL soundURL NSURL fileURLWithPath soundPath NSError error AVAudioPlayer.. NSString soundPath NSBundle mainBundle pathForResource @ bell1 ofType @ caf NSURL soundURL NSURL fileURLWithPath soundPath NSError error AVAudioPlayer theAudio AVAudioPlayer alloc initWithContentsOfURL soundURL error error theAudio setDelegate.. theAudio IBAction pushBell @end @implementation ViewController void viewDidLoad super viewDidLoad NSString soundPath NSBundle mainBundle pathForResource @ beep beep ofType @ caf NSURL soundURL NSURL fileURLWithPath soundPath NSError error..