Can I play without spaces in a WAV file without stuttering?

I have a requirement for perfect gapless loop audio in a BlackBerry 10 application. My loops are stored as WAV files. The method I use to play them:

  • Create a buffer for the WAV file using alutCreateBufferFromFile , which returns bufferID
  • Create a sound source using alGenSources
  • Attach the buffer to the source using alSourcei(source, AL_BUFFER, bufferID)
  • Set loop loop property to true using alSourcei(source, AL_LOOPING, AL_TRUE)
  • Play the source using alSourcePlay(source)

Sound is reproduced in most cases, but during interface transitions (for example, when the backlight turns off or when the application is minimized) the sound stutters.

Any ideas how I can ensure that the sound is smooth all the time?

+7
source share
1 answer

How to start a stream / process of playing a WAV file? Did you have the opportunity to play with priorities and policies in this thread?

I think that these low-level system calls that allow you to change the priority and policy of the process (thread, actually) can help:

Also, look at the relevant pages of the document:

I would start by setting up a policy in FIFO and increasing the priority of the audio file playback process. Hope this helps.

+3
source

All Articles