Hi Frank, i think, sox can't duplicate audio without "buffering" in a file. However, (in linux) there are other commands, which can copy the data, e.g. "tee". I think fiddling around with named pipes and tee, you should be able to do the trick: mkfifo sound mkfifo sound_copy sox -M "|sox sound -p remix 1 $left_channel_effects" "|sox sound_copy -p remix 2 $right_channel_effects" $output $effects_to_both and then in a separate terminal/thread: sox $stereo_input -p | tee sound > sound_copy Hmm, I just tried it and it doesn't work, also sox $stereo_input -p | tee sound sound_copy > /dev/null as second command doesn't work. Probably some buffering issue (feeding the pipes from two separate sox commands works)? Maybe someone else knows how to make this idea work? Cheers, Erich On 22.06.2016 19:19, francolargo wrote: > Greetings Eric, > > I'm part of a small group that is interested in DSP using ARMhf boards like > RPi and BBB. Sox has been a great tool for simpler tasks, but now I would > like to try the objective of the original poster, Charlie. I'm using SoX to > process a stream from a 2-channel ALSA 'recording' source and send filtered > output to a different 2-channel ALSA plug. ...it works great like this: > > sox --buffer 1024 -r 48000 -c 2 -t alsa hw:1,0 -t alsa plug:filter1 gain -h > fir /usr/filter/fir2peak48mild.txt > > This also works with LADSPA filters like this: > > sox --buffer 1024 -r 48000 -c 2 -t alsa hw:1,0 -t alsa plug:filter1 ladspa > ACDf 21 1 0 240 0.707 0 0 ladspa ACDf 21 1 0 240 0.707 0 0 > > However, I'm stuck when I try to split clone the streaming source using the > syntax in your message: > Eric Wong wrote >> sox -M \ >> "|sox i.wav -p remix 1v1 highpass $XO highpass $XO $HI_FX1" \ >> "|sox i.wav -p remix 1v1 lowpass $XO lowpass $XO $LO_FX1" \ >> "|sox i.wav -p remix 2v1 highpass $XO highpass $XO $HI_FX2" \ >> "|sox i.wav -p remix 2v1 lowpass $XO lowpass $XO $LO_FX2" \ >> output.wav \ >> remix -m 1,2 3,4 > > Inserted into the above, this: > “|sox -t alsa hw:1,0 -p remix 1v1 ladspa ACDf 21 1 0 240 0.707 0 0 ladspa > ACDf 21 1 0 240 0.707 0 0” \ > > produces three of these alerts: > "sox FAIL formats: can't open input `hw:1,0': snd_pcm_open error: Device or > resource busy" > > Other attempts to specify and clone the inputs all failed as well: > "sox FAIL sox: Not enough input filenames specified" > > If you have any advice on getting SoX to clone an ALSA streaming source > (e.g., a stereo signal from 'hw:1,0') for input into multiple effect chains, > it would be much appreciated. As well, any additional advice in correctly > defining each sub-stream for ALSA output would undoubtedly help. Output > could go via hardware (hw:0,0), or via user space into an ALSA plug. Either > way, SoX offers advantages in the ability to combine a multitude of useful > effects. [Think: a digital-level "miniDSP" using a RPi...] We just need to > better understand channel creation and management for continuous streaming. > > Many thanks in advance! > > Frank > > > > > -- > View this message in context: http://sox.10957.n7.nabble.com/implementing-loudspeaker-crossovers-using-Sox-LADSPA-plugins-tp5464p5712.html > Sent from the SoX mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San > Francisco, CA to explore cutting-edge tech and listen to tech luminaries > present their vision of the future. This family event has something for > everyone, including kids. Get more information and register today. > http://sdm.link/attshape > _______________________________________________ > Sox-users mailing list > Sox-users@xxxxxxxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/sox-users >
Attachment:
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape
_______________________________________________ Sox-users mailing list Sox-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/sox-users