[LAU] flac2ogg in python - the right way = cross platform

Jostein Chr. Andersen jostein at vait.se
Thu Dec 30 14:35:10 UTC 2010


torsdag 30 december 2010 14.57.32 skrev  Atte André Jensen:
> Hi
> 
> I'm doing some conversion from flac to ogg in python and I wrap sox for
> the actual conversion. I'm happy with it myself (I only run linux), but
> the script has the potential for reaching non-linux users. It seems
> there's no build-in (as in batteries included) way of converting from
> flac to ogg in python across platforms. Is this the sad truth? If so,
> what could be done to make the script work on the other platforms?

The easiest way is probably to write the whole thing in Bash and let the 
Windows user use msys (links in the bottom).

If you want Python, you probably have to have something that can make sure 
that your Python script are guarantied to run by itself and also the related 
helper programs and libraries in the Windows machine.

You can also write a shell script for Windows (develop it in freedos or 
something if you can't use a Windows machine). 

I was active in the Subversion project until ca. 2006 and for the Windows 
installer I used Inno Setup (still going strong). Inno Setup have the ability 
to check if packages exists and download and install missing programs if 
needed, and it's easy to use. You can make Inno download Windows versioins of 
Python, sox and anything anyway and place it in the same folder as your Python 
Script and run it from there. Personally, I would use Perl for this because 
it's easy to include a perl.exe (at least easy 10 years ago) i a Windows 
distro and run scripts, but it might be easy on Python too.

Some links:
  http://www.mingw.org/wiki/MSYS
  http://sourceforge.net/projects/sox/files/sox-win/14.3.1/sox-14.3.1-
win32.exe/download

Good luck.
Jostein




More information about the Linux-audio-user mailing list