T30-WEC7 Audio playback issues

We are experiencing issues with delayed click sounds, or reverb on audio playback.
We have already tried changing the audio buffer size .

"maxBufferSize"      = dword:0x8000

and setting to

"maxBufferSize"      = dword:0x1000

We have created a small audio test application using 2 different methods to play the same file.
Win32 play sound API is not working as expected.

Source code & wave file are attached.

File attached here

Dear @ddufresne

Let’s first talk about the delays. There’s a number of settings you can do in order to reduce them:

  1. As you already found, reducing the mixer buffer size helps to reduce the delay.

    “maxbuffersize” = dword:0x1000
    This buffer is working on 16bit, stereo, 44.1kHz data, so a buffer of 0x1000 byte lasts for about 4096 / (44100 x 2 x 2) = 23 ms.

  2. There are two timing settings which are meant to configure the timing for an external amplifier, but I found it also affects the regular delay (you may have noticed that playback starts faster if the silence period after the last sound was less than 1 sec). To avoid this delay, please set:

    “extAmpOnDelay” = dword:0x00000000
    “extAmpOffTimeout” = dword:0xffffffff
    “PowerDownTimeout” = dword:0xffffffff

The click sounds are related to buffer sizes on different layers. In your test application…

  • the System.Media.SoundPlayer() function can play your test sound without clicking noises, while
  • calling Playsound() shows the problem.

Just to mention for completeness, there would be two additional methods to play sounds, which could again behave differently because of different buffer handling:

  • DirectShow
  • Accessing the wave driver on a lower layer using waveOutOpen()

To avoid the click sounds in your test application I have found two solutions:

  1. Convert your 22kHz, 8bit sample to 44.1kHz, 16bit
    (However, I don’t have an explanation why this helped)

  2. Increase the buffer size for the Playsound() function:

    msPerBuffer = dword:0x3e8 ; buffer for 1000ms
    buffers = dword:4 ; optional, the default is already 4.
    ; Settings of 1…8 did not make any difference for me
    Please let me know if these settings fix all your issues.

Regards, Andy

Thanks @andy.tx ,

I wasn’t in the office today, but I did hear from the team that your answer solved the issues. Thanks for the help.

Thanks Andy,
We implemented the registry value changes & that resolved both issues.
Thanks again,