You are not logged in.
Pages: 1
Hi I've found this script on the net that should convert wma to mp3 :
#!/bin/bash
current_directory=$( pwd )
#remove spaces
for i in *.wma; do mv "$i" `echo $i | tr ' ' '_'`; done
#remove uppercase
for i in *.[Ww][Mm][Aa]; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done
#Rip with Mplayer / encode with LAME
for i in *.wma ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader $i && lame -m s audiodump.wav -o $i; done
#convert file names
for i in *.wma; do mv "$i" "`basename "$i" .wma`.mp3"; done
rm audiodump.wav
I'v found it on http://www.linuxquestions.org/linux/ans … WMA_to_MP3
The problem is when I run it I get:
MPlayer 1.0pre7try2-4.0.3 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium M Banias (Family: 6, Stepping: 5)
Detected cache-line size is 64 bytes
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission denied
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your system startup scripts.
Playing 01_big_machine.wma.
ASF file format detected.
Clip info:
name: Big Machine
author: Goo Goo Dolls
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 192.0 kbit/13.61% (ratio: 24002->176400)
Selected audio codec: [ffwmav2] afm:ffmpeg (DivX audio v2 (FFmpeg))
==========================================================================
Checking audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...
MPlayer interrupted by signal 11 in module: af_preinit
- MPlayer crashed by bad usage of CPU/FPU/RAM.
Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
gcc version. If you think it's MPlayer's fault, please read
DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
won't help unless you provide this information when reporting a possible bug.
rm: cannot remove `audiodump.wav': No such file or directory
And I have no idea why - I don't really know Bash very well...
can anyone help me please?
EDIT : fixed the error message, but it still doesn't work :-(
Offline
Is it possible that you got the WMAs you are trying to convert from an online music service, and they are protected by Digital Rights Management?
Cast off the Microsoft shackles Jan 2005
Offline
Nope...
when I run mplayer and simply open the file it plays perfectly.
When I run the script all the files change their name to .mp3 but the file content is still wma.
I guess the problem is somewhere with piping the output into the wave file or something...
Offline
Well, I've done a similar script myself for my personal use: Audioconvert.
Type ./audiocovert.sh --help for help. To convert a wma file to mp3 do
./audioconvert.sh --format mp3 file.wma
I hope this one helps you.
Offline
Thanks a lot, the script works perfectly :-)
Offline
Well, I've done a similar script myself for my personal use: Audioconvert.
Type ./audiocovert.sh --help for help. To convert a wma file to mp3 do./audioconvert.sh --format mp3 file.wma
I hope this one helps you.
I saved your script in a folder full of wave files, entered:
$ ./audioconvert.sh --format mp3 Intro.wma
And got:
-bash: ./audioconvert.sh: Permission denied
Permissions and ownership aren't the problem, as I get the same thing as root, any ideas?
Offline
chmod +x audioconvert.sh
Just to let every know:
If you are getting permission errors of any kind in an script, your first step should be to not run the script with root.
Permissions fail for a reason. You shouldn't just hand them out the second something complains.
Offline
Thanks for the help, I guess I still have a bit to learn about permissions...
Offline
Pages: 1