Reputation: 8928
I need is to play a wave file multiple times. I don't want to call the hardware/software parameter settings APIs, each time the wave file is played again.
{start...play wave partially...stop}, {start...play wave partially...stop}, {start...play wave partially...stop}, ...
What apis are to be used here ? It is okay to drop the unplayed frames. When I checked alsa API, I can see lots of similar apis suspend/resume/stop .... What is the right combination to start and stop audio for above use case ?
Upvotes: 1
Views: 4225
Reputation: 180060
After a PCM device has been stopped with snd_pcm_drop
, you can restart it by calling snd_pcm_prepare
, writing new data into the buffer, and then calling snd_pcm_start
or using automatic start (which is enabled by default).
Upvotes: 2