Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8211307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:23:05+00:00 2026-06-07T10:23:05+00:00

So, I’m building a threaded IMA ADPCM decoder streaming audio data to OpenAL (see

  • 0

So, I’m building a threaded IMA ADPCM decoder streaming audio data to OpenAL (see below for short description) but I’ve run into some trouble.

One of my issues is that sometimes my call to alBufferData:

alBufferData(*bufferID, format, pcmData, sizeInBytes, bitRate);

returns AL_INVALID_VALUE even though, when checking the parameters they look, e.g., like this:

bufferID='109770616', format='AL_FORMAT_STEREO16', dataPtr='109754188', sizeInBytes='8164'

Any clues, anyone? The actual sound being played sort of stutteres when this happens, and the error usually happens ~10 times in a row (on the same sound). It also usually happens when I repeatedly start the same sound (for example when shooting short bursts with an LMG… ;))

Quick simplified tour of the streaming-decoder-module-thing

How a sound gets played:

  1. A sound is triggered to play.
  2. One bufferSize worth of audio is decoded and the rest is queued for further decoding.
  3. OpenAL is triggered to start playing the sound.

The decoding/streaming loop

  1. For each sound queued for decoding, decode bufferSize worth of audio.
  2. The decoded audio is added to an alBuffer (see call above) with the appropriate bufferID.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:23:06+00:00Added an answer on June 7, 2026 at 10:23 am

    if it’s not too late I’ll tell you the similar problems I had with BufferData and here’s how I fixed it. Although, keep in mind, I don’t know the specifics of your threaded program.

    Invalid value is returned for a number of reasons, the ones I know of are…
    -Queuing new buffers (to a streaming source) if the source already has a bufferID assigned (because it gets set to static if you set buffer id). If so, remove the ID in the source property.
    -Changing the buffer format mid play. You can’t change any buffer setting (fmt,samplerate) except for the buffer data itself once a source starts playing, even if it is on another queued one.

    It sounds like you might be changing one of these settings in another thread.

    Another thing that may cause pops is replaying the sound. Calling play again just stops the source cold, then rewinds the current buffer and starts playing from the beginning. Playing a gun sound like that won’t sound like you want it (layered i assume). 2 options, mix the remaining gun sound into the buffer then replay it, but this might not work. another fool proof is just to use multiple sources and rotate which ones get called on each gun fire.

    good luck on your project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.