<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">you could try is making use of the buffering attributes in<br>
pa_simple_new. Specifically, setting prebuf to a suitable value.</div></blockquote><div><br></div><div>I tried setting prebuf to -1, 0, 1, 2, 4, 16, and 320. Made no difference to me.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Another thing to check is if there are a couple of silent samples at the<br>
beginning of the problematic wav files</div></blockquote><div><br></div><div>I checked. The first 20ms are silent samples.<br></div><div>Attached is the file.<br><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 29, 2021 at 12:06 AM Sean Greenslade <<a href="mailto:sean@seangreenslade.com">sean@seangreenslade.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Aug 27, 2021 at 04:57:07PM +0200, mindfsck wrote:<br>
> I seem to be to silly for it:<br>
> # sox in.wav -r 22050 out.wav resample<br>
> sox FAIL formats: can't open input file `out.wav': No such file or directory<br>
> <br>
> Of course there is no out.wav since that's what I want to create!<br>
<br>
I would not bother with trying to change sample rates, that's very<br>
unlikely to be the issue. Plus, a lot of sound cards only support 44.1<br>
kHz and 48 kHz, so pulse would just have to resample it again on playback.<br>
<br>
One thing you could try is making use of the buffering attributes in<br>
pa_simple_new. Specifically, setting prebuf to a suitable value. There's<br>
some helpful info in the buffer_attr docs page here:<br>
<br>
<a href="https://www.freedesktop.org/software/pulseaudio/doxygen/structpa__buffer__attr.html" rel="noreferrer" target="_blank">https://www.freedesktop.org/software/pulseaudio/doxygen/structpa__buffer__attr.html</a><br>
<br>
Another thing to check is if there are a couple of silent samples at the<br>
beginning of the problematic wav files. If the first sample is non-zero,<br>
that could potentially cause pops on playback.<br>
<br>
--Sean<br>
<br>
</blockquote></div></div>