¡@

Home 

2014/10/15 ¤U¤È 10:03:31

iphone Programming Glossary: afileext

How do you completely remove and release memory of an OpenAL sound file?

http://stackoverflow.com/questions/2035975/how-do-you-completely-remove-and-release-memory-of-an-openal-sound-file

This is how I load the sounds void loadSoundWithKey NSString aSoundKey fileName NSString aFileName fileExt NSString aFileExt Check to make sure that a sound with the same key does not already exist NSNumber numVal soundLibrary objectForKey aSoundKey.. file which has been passed in CFURLRef fileURL CFURLRef NSURL fileURLWithPath bundle pathForResource aFileName ofType aFileExt retain if fileURL data MyGetOpenALAudioData fileURL size format freq CFRelease fileURL if error alGetError AL_NO_ERROR NSLog.. Error attaching audio to buffer x n error else NSLog @ ERROR SoundManager Could not find file ' @. @' aFileName aFileExt data NULL Place the buffer ID into the sound library against aSoundKey soundLibrary setObject NSNumber numberWithUnsignedInt..