<div dir="ltr"><span style="font-size:12.800000190734863px">> I've been knocking my head against a wall for more than a year trying to</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">> figure out how to correctly mix two streams of audio while using</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">> libsndfile for input and libao for output.  My main requirement is that</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">> I cannot assume anything about the output drivers -- that is, I cannot</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">> depend on the output driver (ALSA, OSS, Sun, etc) being able to do the</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">> mixing for me.  Many of my target platforms lack any sort of mixing</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">> services.  I need to do this myself.  I tried starting a mixer/player</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">> thread that would work in a producer/consumer relationship with one or</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">> two audio file decoder threads.  I can play one sound at a time just</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">> fine. When I try to do both, I get distortion followed by a segfault.</span><br style="font-size:12.800000190734863px"><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">Hi,</span><br style="font-size:12.800000190734863px"><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">not sure if I understood correctly: do you just want to mix N files?</span><br style="font-size:12.800000190734863px"><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">Like you I'm learning libsndfile and libao so this is my attempt to mix some audio files:</span><br style="font-size:12.800000190734863px"><br><div><a href="http://pastebin.com/dm7z8b3Z" rel="noreferrer" target="_blank">http://pastebin.com/dm7z8b3Z</a><br style="font-size:12.800000190734863px"><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">HTH,</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">Andrea</span><br style="font-size:12.800000190734863px"><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">P.S.</span><br style="font-size:12.800000190734863px"><span style="font-size:12.800000190734863px">Can someone explain line 88 (I already read the sndfile FAQ)?</span><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 16, 2016 at 11:30 PM,  <span dir="ltr"><<a href="mailto:linux-audio-dev-owner@lists.linuxaudio.org" target="_blank">linux-audio-dev-owner@lists.linuxaudio.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You are not allowed to post to this mailing list, and your message has<br>
been automatically rejected.  If you think that your messages are<br>
being rejected in error, contact the mailing list owner at<br>
<a href="mailto:linux-audio-dev-owner@lists.linuxaudio.org">linux-audio-dev-owner@lists.linuxaudio.org</a>.<br>
<br>
<br><br>---------- Forwarded message ----------<br>From: Andrea Del Signore <<a href="mailto:sejerpz@gmail.com">sejerpz@gmail.com</a>><br>To: <a href="mailto:linux-audio-dev@lists.linuxaudio.org">linux-audio-dev@lists.linuxaudio.org</a><br>Cc: <br>Date: Mon, 16 May 2016 21:26:40 +0000 (UTC)<br>Subject: Re: [LAD] mixing while using libao and libsndfile<br>On Sun, 15 May 2016 16:34:34 +0000, David Griffith wrote:<br>
<br>
> I've been knocking my head against a wall for more than a year trying to<br>
> figure out how to correctly mix two streams of audio while using<br>
> libsndfile for input and libao for output.  My main requirement is that<br>
> I cannot assume anything about the output drivers -- that is, I cannot<br>
> depend on the output driver (ALSA, OSS, Sun, etc) being able to do the<br>
> mixing for me.  Many of my target platforms lack any sort of mixing<br>
> services.  I need to do this myself.  I tried starting a mixer/player<br>
> thread that would work in a producer/consumer relationship with one or<br>
> two audio file decoder threads.  I can play one sound at a time just<br>
> fine. When I try to do both, I get distortion followed by a segfault.<br>
><br>
> So, I'm back to a demo program.  What must I do to this program to cause<br>
> it to start playing one audio file, then play another N seconds later?<br>
><br>
> David Griffith <a href="mailto:dave@661.org">dave@661.org</a><br>
><br>
<br>
Hi,<br>
<br>
not sure if I understood correctly: do you just want to mix N files?<br>
<br>
I'm a noob with both libsndfile and libao :)<br>
<br>
Here my code: <a href="http://pastebin.com/dm7z8b3Z" rel="noreferrer" target="_blank">http://pastebin.com/dm7z8b3Z</a><br>
<br>
HTH,<br>
Andrea<br>
<br>
P.S.<br>
Can someone explain line 88 (I already read the sndfile FAQ)?<br>
<br>
<br></blockquote></div><br></div>