[alsa-devel] Use of snd_pcm_format_set_silence

Clemens Ladisch clemens at ladisch.de
Wed Jan 20 22:56:50 CET 2016


Ankhit Vivekananda wrote:
> I have an application where in I need to silence the first few samples of
> the buffer that is read from snd_pcm_readi(). In order to do this, I call
> the snd_pcm_format_set_silence() providing the same buffer that the
> snd_pcm_readi() reads to.
>
> 1) By doing this, is there going to be a timing delay due to the use of
> snd_pcm_format_set_silence()?

That function just modifies memory; it does not affect any PCM device.

> 2) Is snd_pcm_format_set_silence() the correct function to achieve this
> goal or are there better methods?

You already know your sample format; memset(0) might be simpler.


Regards,
Clemens


More information about the Alsa-devel mailing list