Re: [LAU] audio collage?

From: Atte André Jensen <atte.jensen@email-addr-hidden>
Date: Sat Jan 09 2010 - 13:24:16 EET

Renato wrote:
> Obviously i forgot to attach the file ;)

I have looked at your script, which unfortunately doesn't work here, I
get "soxi FAIL formats: no handler for file extension `mp3'". Besides
that I have a couple of suggestions or thoughts, you might want to consider:

1) It's good practice to output some kind of help or usage message when
a program is called with no options. Right now I need to look at the
python code to tell what's going on.

2) You should try to avoid wrapping shell commands in os.system calls
whenever possible. Obviously the call to sox need to be that way, but
"touch" (for your need, that is create empty file) can be implemented in
python:

     def touch(self, file):
         if not os.path.exists(file):
             f = open(file,"w")
             f.write('')
             f.close()

In general you should try to stick to python buildins, including using
tempfile.mktemp() for a tmp file instead of handling it yourself.

3) Although I did this myself, sox is not really nice to wrap in the
first place, since it sometimes changes the names of the arguments and
stuff like that. So your script might not work after the next upgrade of
sox :-(

4) I'm not sure mp3 files are the most obvious file format to work with,
any specific reason you're not working with simple .wav's?

Hope it's ok that I made these suggestions :-)

-- 
Atte
http://atte.dk   http://modlys.dk
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Sat Jan 9 16:15:02 2010

This archive was generated by hypermail 2.1.8 : Sat Jan 09 2010 - 16:15:02 EET