So, I am creating a streaming IMA ADPCM decoder that transmits audio data to OpenAL (see brief description below), but I ran into some problems.
One of my problems is that sometimes my call to alBufferData is:
alBufferData(*bufferID, format, pcmData, sizeInBytes, bitRate);
returns AL_INVALID_VALUE
, although when checking the parameters they look, for example, as follows:
bufferID='109770616', format='AL_FORMAT_STEREO16', dataPtr='109754188', sizeInBytes='8164'
Any clues, anyone? The actual sound is played in the form of stuttering when this happens, and the error usually occurs ~ 10 times in a row (on the same sound). This also usually happens when I repeatedly play the same sound (for example, when shooting short bursts using LMG ...;))
Quick simplified stream-decoder-module tour
How is the sound reproduced:
- Sound starts to play.
- One sound in bufferSize format is decoded, and the rest are queued for further decoding.
- To start sound playback, OpenAL is launched.
Decoding / Streaming Cycle
- For each sound placed in the queue for decoding, decodes the buffer value of the sound.
- The decoded sound is added to alBuffer (see call above) with the corresponding buffer identifier.
source share