munawarb / Three-D-Velocity

a fighter jet flight Simulator for the blind and visually Impaired
GNU Affero General Public License v3.0
24 stars 18 forks source link

AudioBuffers are destroyed prematurely, causing distortions and crashes while streaming ogg files #102

Closed munawarb closed 5 years ago

munawarb commented 5 years ago

Instead of holding the memory allocated to an AudioBuffer object, it's being destroyed as soon as it is submitted to the SourceVoice. This is against XAudio2 API which requests the memory to be allocated to it until the buffer in question has been played, since it doesn't create a copy of the buffer. The result of the premature destruction is the XAudio2 API reading memory to which it doesn't have access, creating distortions and memory access violations.