* Question about syntax for --sox−pipe with output to file
@ 2016-08-05 0:57 Pierow
2016-08-05 10:00 ` Pierow
2016-08-05 10:38 ` Eric Wong
0 siblings, 2 replies; 4+ messages in thread
From: Pierow @ 2016-08-05 0:57 UTC (permalink / raw)
To: sox-users
I am using -p to pipe a series of three SoX commands that generate three tones:
play "|sox -n -p synth .276 sine 1200 gain -1" "|sox -n -p synth .276
sine 900 gain -1" "|sox -n -p synth .380 sine 1200 gain -1"
I would like to output the resulting three tones to a WAV file. I'm
sure that this is something that is easy to do but nothing that I have
tried seems to work. I have read the man page and searched through
the archives of the mailing list but I can't seem to find anything
that works with the piped commands.
Is there a way to tell direct this output to a file instead of playing
to system audio?
Thanks!
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about syntax for --sox−pipe with output to file
2016-08-05 0:57 Question about syntax for --sox−pipe with output to file Pierow
@ 2016-08-05 10:00 ` Pierow
2016-08-05 10:38 ` Eric Wong
1 sibling, 0 replies; 4+ messages in thread
From: Pierow @ 2016-08-05 10:00 UTC (permalink / raw)
To: sox-users
My apologies. I had an error in my command that got clobbered when I
copied and pasted. With that (admittedly very silly) mistake
corrected, I am now able to write the output directly to a file by
simply appending a filename. Clearly I need more sleep. :)
On Thu, Aug 4, 2016 at 7:57 PM, Pierow <pierow@thepyro.com> wrote:
> I am using -p to pipe a series of three SoX commands that generate three tones:
>
> play "|sox -n -p synth .276 sine 1200 gain -1" "|sox -n -p synth .276
> sine 900 gain -1" "|sox -n -p synth .380 sine 1200 gain -1"
>
> I would like to output the resulting three tones to a WAV file. I'm
> sure that this is something that is easy to do but nothing that I have
> tried seems to work. I have read the man page and searched through
> the archives of the mailing list but I can't seem to find anything
> that works with the piped commands.
>
> Is there a way to tell direct this output to a file instead of playing
> to system audio?
>
> Thanks!
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about syntax for --sox−pipe with output to file
2016-08-05 0:57 Question about syntax for --sox−pipe with output to file Pierow
2016-08-05 10:00 ` Pierow
@ 2016-08-05 10:38 ` Eric Wong
2016-08-05 12:23 ` Pierow
1 sibling, 1 reply; 4+ messages in thread
From: Eric Wong @ 2016-08-05 10:38 UTC (permalink / raw)
To: sox-users
Pierow <pierow@thepyro.com> wrote:
> I am using -p to pipe a series of three SoX commands that generate three tones:
>
> play "|sox -n -p synth .276 sine 1200 gain -1" "|sox -n -p synth .276
> sine 900 gain -1" "|sox -n -p synth .380 sine 1200 gain -1"
>
> I would like to output the resulting three tones to a WAV file. I'm
> sure that this is something that is easy to do but nothing that I have
> tried seems to work. I have read the man page and searched through
> the archives of the mailing list but I can't seem to find anything
> that works with the piped commands.
See the short SYNOPSIS at the top of the manpage,
many people probably skip over it :)
> Is there a way to tell direct this output to a file instead of playing
> to system audio?
Same as play, almost:
sox "|sox -n -p synth .276 sine 1200 gain -1" \
"|sox -n -p synth .276 sine 900 gain -1" \
"|sox -n -p synth .380 sine 1200 gain -1" \
output.wav
Basically, "play $INPUTS" is the same as "sox $INPUTS -t $FORMAT"
So if you use alsa, the following should behave just like play
did for you:
sox "|sox -n -p synth .276 sine 1200 gain -1" \
"|sox -n -p synth .276 sine 900 gain -1" \
"|sox -n -p synth .380 sine 1200 gain -1" \
-t alsa
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about syntax for --sox−pipe with output to file
2016-08-05 10:38 ` Eric Wong
@ 2016-08-05 12:23 ` Pierow
0 siblings, 0 replies; 4+ messages in thread
From: Pierow @ 2016-08-05 12:23 UTC (permalink / raw)
To: sox-users
Thank you Eric. I appreciate the follow-up.
On Fri, Aug 5, 2016 at 5:38 AM, Eric Wong <normalperson@yhbt.net> wrote:
>
> See the short SYNOPSIS at the top of the manpage,
> many people probably skip over it :)
>
>> Is there a way to tell direct this output to a file instead of playing
>> to system audio?
>
> Same as play, almost:
>
> sox "|sox -n -p synth .276 sine 1200 gain -1" \
> "|sox -n -p synth .276 sine 900 gain -1" \
> "|sox -n -p synth .380 sine 1200 gain -1" \
> output.wav
>
> Basically, "play $INPUTS" is the same as "sox $INPUTS -t $FORMAT"
>
> So if you use alsa, the following should behave just like play
> did for you:
>
> sox "|sox -n -p synth .276 sine 1200 gain -1" \
> "|sox -n -p synth .276 sine 900 gain -1" \
> "|sox -n -p synth .380 sine 1200 gain -1" \
> -t alsa
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-05 12:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-05 0:57 Question about syntax for --sox−pipe with output to file Pierow
2016-08-05 10:00 ` Pierow
2016-08-05 10:38 ` Eric Wong
2016-08-05 12:23 ` Pierow
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/sox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).