Jump to content
  • Advertisement
Sign in to follow this  
Grain

OpenAL Queuing and Unqueuing buffers.

This topic is 4908 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What I would first check for is that the stuff making the noise that is filling the buffer is not putting any silence in there.

I would suggest simplifing and try filling it completely with white noise to see if there is any break in the white noise or not. Either that or logging each byte created by that

[source lang="c++]
for(int i = 0; i < samplesPerBuffer ; i++)
{
DelayA.push_front(-DecayFactor * DelayB.front()); DelayB.pop_front();
DelayB.push_back(-DecayFactor * DelayA.back()); DelayA.pop_back();
PickUpA--; PickUpB++;

Data16 = (*PickUpA + *PickUpB) * 32767;
Fin.push_front(*PickUpA + *PickUpB); Fin.pop_back();
}



... block of code, and checking that for silence.

Share this post


Link to post
Share on other sites
Advertisement
Ugh... I found the problem; as usual it wasn’t my logic but some stupid little thing.

alBufferData(buffers,AL_FORMAT_MONO16,Data16,samplesPerBuffer,sampleFreq)

The samplesPerBuffer field isn’t actually “samples per buffer” but size in bytes which means that code works for AL_FORMAT_MONO8, for AL_FORMAT_MONO16 I need samplesPerBuffer*2 since every sample is 2 bytes.

No where in any Open AL documentation or example tutorial was that made clear.
I feel like I need to strangle somebody.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!