Re: audio collage?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/listinfo/linux-audio-user

[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux