[LAD] audio recording through pipe using mplayer and sox sometimes has incorrect speed

Justin Smith noisesmith at gmail.com
Thu Apr 9 18:28:17 UTC 2009


On Thu, Apr 9, 2009 at 11:17 AM, Stephen Sinclair <radarsat1 at gmail.com> wrote:
> On Thu, Apr 9, 2009 at 8:53 AM, Paul Davis <paul at linuxaudiosystems.com> wrote:
>> On Thu, Apr 9, 2009 at 8:24 AM, Arnold Obdeijn <arnold.obdeijn at gmail.com> wrote:
>>> Hi all,
>>>
>>> I am using mplayer, sox and tee to capture streaming internet radio
>>> and send it both to an audio recognition program and to a file
>>> (recording).
>>> This is how I do it:
>>>
>>> mplayer -playlist {url}  -nocache -af volnorm -msglevel all=1 -nolirc
>>> -vc dummy -vo null -ao pcm:file={$fifo1} &
>>>
>>> sox -S {$fifo1} -c 1 -r 8000 -t wav - resample | tee {$recording} |
>>> tee {$fifo2} & ......
>>>
>>> $fifo1 and $fifo2 are named pipes, $fifo2 is processed by an audio
>>> recognition program. The idea is that the audio is converted to low
>>> quality wav (8000Hz mono) after which it is fed to the program and
>>> simultaneously recorded.
>>
>> Not that I want to suggest anything to massively off-topic, but I hope
>> you realize that this is a perfect example of the kind of scenario
>> that JACK was designed to handle.
>
>
> On that note, is there a JACK command-line utility that is as easy to
> use as "|"?
>
> That would be cool, if a, b, and c were JACK-enabled applications:
>
> $ jack-pipe a : b : c
>
>
> So much faster than opening up qjackctl and making connections
> manually.  Okay, clearly this doesn't handle multichannel very well
> however.
>
>
> Steve
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev at lists.linuxaudio.org
> http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
>

Off the top of my head, something could be put together with a shell
script using the jack_connect program. If you are OK with a single
purpose script that runs and connects two specific known programs,
this will be easy, making it work with arbitrary programs provided as
arguments is better done with something like lash, or patch-bay
persistence.



More information about the Linux-audio-dev mailing list