question on creating an mp3

Thomas Stivers stivers_t at tomass.dyndns.org
Mon Aug 1 22:09:22 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

On Mon, Aug 01, 2005 at 06:50:34 PM -0400, Scott Howell wrote:
> Thank you sir. I did try this out and ran into one small problem and not 
> sure if its a question of syntax or a question of how I'm envoking the 
> script.
> 
> when putting the script into a directory of mp3 files and just running 
> it with no arguments, I get the following.
> 
> =:         ERROR: cannot open `=' (No such file or directory)
> Foreigner: ERROR: cannot open `Foreigner' (No such file or directory)
> play_file: Cannot open Foreigner for reading.
> 
> Now if I understand correctly, the file = "${file/%.mp3/}"
> is the variable that the output of ls would be used to take the variable 
> and substitue that for the actual name. Not sure of the purpose of the 
> brackets and slashes, but yes some of these files will have names using 
> the dash, underscore, and in some cases spaces and the like.
> Do I understand correctly?
> 
> Thanks for your help, if we can get this going, I'll give you the credit 
> and call taht a nice donation for those of us who choose not to use 
> windows vbs to accomplish what can be done with Linux...grin

for file in *.mp3 ; do
	file="${file/%.mp3/}"
	say -fo "${file}.tmp" -a "$file"
	lame "${file}.tmp" -o "${file}.talk"
	rm "${file}.tmp";
done

I expect its something to do with quoting all the file names, but I
can't tell exactly what it might be for any particular files. I fixed a
few little problems that were the result of dashing that off under the
influence of too much coffee, but there seems to be some problem with
the say command where it won't write the text I give to it with the -a
option to the file specified by -fo. Alas the closed source nature of
say prevents me from figuring it out easily. The solution probably
involves writing all the file names to temporary text files and then
passing them to say using the -fi option. I'll fiddle with it a little
more and let you know if I get a good one working as this just seems
like its a cool idea to get working and it should be pretty easy once I
get all the cob webs out of my head regarding shell scripting.

- -- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

Thomas Stivers	e-mail: stivers_t at tomass.dyndns.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC7tXS5JK61UXLur0RAw//AJ9ZfVGapPT9RaXPS9tOjQSbBgCzXgCfYtPj
Z39gRFebfC4e/YOCbmXKZpE=
=EPUF
-----END PGP SIGNATURE-----




More information about the Speakup mailing list