larsimmisch / pyalsaaudio

ALSA wrappers for Python
http://larsimmisch.github.io/pyalsaaudio/
Other
214 stars 74 forks source link

Feature: Non-interleaved write #139

Open oomzay opened 7 months ago

oomzay commented 7 months ago

For some applications non-interleaved channel i/o (snd_pcm_writen) is more convenient, and likely more efficient than snd_pcm_writei.

larsimmisch commented 7 months ago

Just implementing snd_pcm_writen should be fairly simple, but updating the documentation would be a chore for me.

RonaldAJ commented 7 months ago

@oomzay Can you draft documentation for the function you would like to have?

oomzay commented 7 months ago

PCM.write_noninterleaved(data_n)

Writes (plays) the sound in data_n. Data_n must be a list of sample buffers, one buffer per output channel. The length of each buffer must be a multiple of the sample size, and should be exactly the size of a period. Every buffer must hold the same number of samples. If less than ‘period size’ frames are provided, the actual playout will not happen until more data is written.

(Then as for PCM.write())