From: "Conway S. Smith" <beolach@comcast.net>
To: Santosh Puranshettiwar <santosh@wirkle.com>
Cc: linux-newbie@vger.kernel.org
Subject: Re: Combining three commands
Date: Wed, 30 Aug 2006 11:26:30 -0600 [thread overview]
Message-ID: <44F5CA46.6000509@comcast.net> (raw)
In-Reply-To: <44F438FB.5080207@wirkle.com>
Santosh Puranshettiwar wrote:
> $ /home/foouser/decoder input-file.amr temp.raw
> $ sox –r 8000 –w –c 1 –s temp.raw –r *8000* –w –c 1 temp.wav
> $ lame –h temp.wav file.mp3 --tt song-title --ta artist --tl album
>
> Here are three commands that I wish to combine in one line so as to
> avoid any temporary files?
> Could anyone suggest me a solution.
>
> Santosh.
I'm not entirely sure that I understand what you're asking, but if
you're asking how to create the end "file.mp3" without creating the
"temp.raw" and "temp.wav" files, then you can do that if all of your
/home/foousr/decoder can write its output to standard output instead of
a file. Most decoder apps (including sox & lame) are able to do that,
by specifying a single dash, "-", for the filename. Assuming
/home/foouser/decoder works in the standard way, you then connect its
standard output to the standard input of the next command like this:
$ /home/foouser/decoder input-file.amr "-" | sox –r 8000 –w –c 1 –s -t
raw "-" –r *8000* –w –c 1 -t wav "-" | lame –h "-" file.mp3 --tt
song-title --ta artist --tl album
That should tell /home/foouser/decoder to read a datastream from
input-file.amr, and write the decoded datastream to stdout; that stdout
is then connected by a pipe to the stdin of the sox command, which will
read its input from the stdin, with the assumption that the input is in
raw format, and write its output to stdout in wav format (I added the
"-t raw" & "-t wav" options), and then the stdout of the sox command is
connected to the stdin of the lame command, and the lame command reads
its input from stdin, and writes to file.mp3.
Hope this helps,
Conway S. Smith
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
next prev parent reply other threads:[~2006-08-30 17:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-29 12:54 Combining three commands Santosh Puranshettiwar
2006-08-30 17:26 ` Conway S. Smith [this message]
2006-08-31 13:52 ` Santosh Puranshettiwar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44F5CA46.6000509@comcast.net \
--to=beolach@comcast.net \
--cc=linux-newbie@vger.kernel.org \
--cc=santosh@wirkle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.