Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Generate LAME-encoded audio MP3 from text' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Generate LAME-encoded audio MP3 from text
Authored by: hypert on Sep 30, '04 01:50:32PM
I combined some of the items mentioned here (except for the named pipe - what's the advantage of them?).

#!/bin/csh

set TMP_TXT=`mktemp`
set TMP_AIF=`mktemp`

strings $1 >! $TMP_TXT
say -v Vicki -f $TMP_TXT -o $TMP_AIF
lame $TMP_AIF $1:r.mp3

rm -f $TMP_TXT
rm -f $TMP_AIF
I have one question, though. What does the ":r" modifier do? To "osxpounder", just type "fink install lame" to get lame installed (assuming you have fink installed, which is almost a requirement IMHO).

[ Reply to This | # ]
Generate LAME-encoded audio MP3 from text
Authored by: hypert on Sep 30, '04 02:02:32PM

Regarding the ":r" modifier, I couldn't find it in MacOS's man pages, but found it under Solaris:

Modifiers
After the optional word designator, you can add one of the
following modifiers, preceded by a :.

h Remove a trailing pathname component, leaving the
head.

r Remove a trailing suffix of the form `.xxx', leaving
the basename.

e Remove all but the suffix, leaving the Extension.

etc.



[ Reply to This | # ]
named pipes
Authored by: fracai on Sep 30, '04 03:10:35PM

I think I'll type up a submission for this after work.

named pipes provide piping support for apps that don't support piping.
for example, you can't pipe the output of mplayer to standard out, so it's hard to redirect converted audio to another app without saving the audio to disk first. instead you can creat a named pipe and save the mplayer output to the pipe and have the second app read from the pipe.

for something like this it saves the hassle of some temp files.

another example, I created a script a short time ago that would dump the real audio stream of a radio program, convert the dump to wav, convert the wav to mp3

there is a wasted dump and wav file now. both of which can take up a significant amount of space, the wav especially.
a named pipe (allong with doing the conversion of the audio with mplayer instead of saving the dump and then converting) allowed me to direct the wav output to a pipe that was being read by lame. this eliminated the biggest temp file, the wav.

I'll write up something intelligable with links after work.

---
i am jack's amusing sig file



[ Reply to This | # ]
Generate LAME-encoded audio MP3 from text
Authored by: osxpounder on Sep 30, '04 07:32:49PM

Thanks for the fink tip, but nope, it doesn't work. I just installed fink. When I run the included Pathsetup program, it reports that fink is installed correctly. Nevertheless, I still get:

$ fink install lame
/usr/bin/sudo /sw/bin/fink install lame
Information about 1740 packages read in 1 seconds.
Failed: no package found for specification 'lame'!

... when I type "fink install lame".

---
--
osxpounder



[ Reply to This | # ]
Generate LAME-encoded audio MP3 from text
Authored by: hypert on Oct 01, '04 11:07:57PM

I've never had problems with fink before. Try "fink list" to see a list of available packages (hundreds!) or "fink list lame" to see the 3 different lame packages. If (when) they show up, you'll be installing lame, which will install lame-shlibs with it.

If fink doesn't seem to know about lame (and those list commands don't show anything), it seems like a bad fink install.

Anyone else have an idea?



[ Reply to This | # ]