When I swtiched from Windows to Linux I still had a bunch of wma's amoungst my mp3 that were not playing nice with my system. Although, I installed the appropriate plugins for gstreamer so that I could play wma, I could not easily manipulate my tags with easytag so I decided to convert all my wma's to mp3's.
I found a couple of how-to on conveting my files with mplayer but I wanted to use gstreamer so I worked out a short one liner to convert my files.
First, for reference, the syntax for converting wma to mp3 with gstreamer is:
This would convert filename.wma to filename.mp3 in your current directory assuming that you have the wma plugins for gstreamer and lame installed. Run this with a single file to ensure everything is working. You might get the warning message:Code:gst-launch filesrc location=filename.wma ! spider ! lame ! filesink location=filename.mp3
I'm not sure what this means but I suspect that gstreamer can read the wma tags.Code:Couldn't find matching gstreamer tag for audio-codec
Next, you might want to see which files you need to convert using the command:
This will traverse you current directory and all subdirectories for files with the wma extension.HTML Code:find . -name *.wma -print
Finally, programmatically create a script that will contain a series con commands to convert you files, make the script executable, and run in.
This will create a file in your current directory named convwmamp3 which will contain the individual commans to convert the files. It will probably take a while to execute if you have a lot of files to convert. Also, I suspect that there is a way to directly execute each command without an intermediary file. I'd be curious to find out how to do that if anybody knows how.Code:find . -name *.wma -exec echo gst-launch filesrc location="'{}'" ! spider ! lame ! filesink location="'{}'" \; | sed -e 's/wma/mp3/2' > convwmamp3 chmod +x convwmamp3 ./convwmamp3
When the script finishes running, you will have a mp3 version of the wma in the same directory as the original file.
Notes:
1) This does not give tag your mp3's . The original wma's are left in tact. You will have to manually tag them.
2) This does not check to see if you have sufficient space for the conversions. Keep an eye on the running script if you are running low on diskspace
3) You might be able to convert from any format that gstreamer supports with the appropriate plugins, but since I only have mp3's and wma's, I could not test this.
4) There might be a way to configure lame to have different default options. I don't know how to do that. Any help would be appreciated.


Reply With Quote
