iPhone と OpenAL には XCode 4.5 を使用しています。問題は、サウンドを再生した後、サウンド バッファを削除できないことですalSourcePlay().
。ソースを再生しない場合、バッファは削除され、nemory は問題なく解放されます。
読み込み音:
alGenBuffers(1, &bufferID);
// Loading awaiting data blob into buffer.
alBufferData(bufferID, format, outData, size, freq);
// Getting source ID from OpenAL.
alGenSources(1, &sourceID);
// Attacing buffer to source.
alSourcei(sourceID, AL_BUFFER, bufferID);
//playing sound (if i comment this line, the problem dissapears)
alSourcePlay(soundId);
リリース音:
//detaching buffer
alSourcei(sourceID, AL_BUFFER, bufferID);
//deleting source
alDeleteSources(1, &sourceID);
//deleting buffer
alDeleteBuffers(1, &bufferID);
バッファを削除してもエラーは発生しませんが、メモリから解放されません。Instrumentsを使用してメモリを監視しています。
解決策を探し、OpenAL のドキュメントを読むのに 1 週間を費やしました。
OpenALの経験がある方、助けてください!
ありがとうございました!