[pulseaudio-discuss] Audible plop at beginning when using pcat-simple
mindfsck
mindfsck at gmail.com
Fri Sep 3 09:54:04 UTC 2021
Thank you Sean, that did indeed the trick and my files play nicely now!
Do you expect to add this WAV header detection (and skipping) in a future
release or do you restrict it to PCM (and user code must skip)?
On Fri, Sep 3, 2021 at 8:05 AM Sean Greenslade <sean at seangreenslade.com>
wrote:
> On Sun, Aug 29, 2021 at 07:02:25PM +0200, mindfsck wrote:
> > or use 'vlc' or use any Video/Audio playback you have on your
> machine.Sigh,
> > I may just reach out for alternative APIs instead of trying to convince
> > people that this might be a bug in the simple API you provide.
>
> Apologies for leading you down a dead-end. I've taken a closer look
> at the code and found what the problem is. The pacat-simple.c example is
> expecting raw PCM sample data in the file. Since you're giving it a .WAV
> file, there is a metadata header at the beginning that it is trying to
> interpret as audio.
>
> Try inserting this line just above the /* Read some data ... */ line:
>
> read(STDIN_FILENO, buf, 44); // Discard the .WAV header
>
> --Sean
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20210903/564a1d3f/attachment.htm>
More information about the pulseaudio-discuss
mailing list