Play small wave file without using "snd_pcm_plugin_flush"

Hi all,

I’m trying to play wave file with QNX. I use the example wave.c and all
works fine.

What I want to do is :

  • play small wave file (max length 150ms) very quickly (more than 5 time per
    second)

My problem :

  • when I use the wave.c function I can play 1 wave file every 1,5 s (because
    the block buffer size is 32768 and my PCM is 22.050 KHz)

What I try :

  • when I try to use SND_PCM_MODE_STREAM snd_pcm_plugin_params() say :
    “Invalid argument”
  • when I use SND_PCM_MODE_BLOCK I did not find how to reduce the buffer size
    of 32768

My question :

  • can someone explain me how I can play small wave file very quickly.


    Thanks in advance for any advice.

Jeff HOFFMEYER

When I use wave.c to play a music, there exists a time delay from program
start running to the music start.
I found that the delay can be reduced by modifying the line
“pp.buf.block.frags_max = 1;” to
“pp.buf.block.frags_max = pi.max_fragment_size;”
I’m not sure it can help you or not…
“Jeff HOFFMEYER” <jean-francois.hoffmeyer@schiller.fr> ¼¶¼g©ó¶l¥ó·s»D
:a8jqll$ou4$1@inn.qnx.com

Hi all,

I’m trying to play wave file with QNX. I use the example wave.c and all
works fine.

What I want to do is :

  • play small wave file (max length 150ms) very quickly (more than 5 time
    per
    second)

My problem :

  • when I use the wave.c function I can play 1 wave file every 1,5 s
    (because
    the block buffer size is 32768 and my PCM is 22.050 KHz)

What I try :

  • when I try to use SND_PCM_MODE_STREAM snd_pcm_plugin_params() say :
    “Invalid argument”
  • when I use SND_PCM_MODE_BLOCK I did not find how to reduce the buffer
    size
    of 32768

My question :

  • can someone explain me how I can play small wave file very quickly.


    Thanks in advance for any advice.

Jeff HOFFMEYER
\