LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Tags used in this thread
Popular LQ Tags

Reply
 
Thread Tools
Old 10-12-2003, 05:01 PM   #16
jimmmac
Member
 
Registered: Oct 2002
Location: Florida
Distribution: RedHat
Posts: 109
Thanked: 0
WMA to WAV conversion


[Log in to get rid of this advertisement]
Hi everyone

I tried two of the scripts and they didn't work for me. I need to convert WMA files to WAV files so that I can burn them to a cd using Xcdroast. This is the first time I am attempting to create a music cd and need a lot of help. I got these legally from BuyMusic.com. Hated to do it, but I wanted to be legal and I didn't want to wait any longer for a Linux supported product. They are in WMA format and I want to cut them to a Cd I can play in my car cd player. I tried this

mplayer Panama.wma -ao pcm -aofile Panama.wav

with one of the files and got the following message

Using GNU internationalization
Original domain: messages
Original dirname: /usr/share/locale
Current domain: mplayer
Current dirname: /usr/local/share/locale


MPlayer 0.90rc5-3.2.2 (C) 2000-2003 Arpad Gereoffy (see DOCS)

CPU: Intel Celeron 2/Pentium III Coppermine,Geyserville (Family: 6, Stepping: 6)
Detected cache-line size is 32 bytes
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 SSE

Reading config file /usr/local/etc/mplayer/mplayer.conf: No such file or directory
Reading config file /root/.mplayer/config
Reading /root/.mplayer/codecs.conf: can't open '/root/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: 50 audio & 136 video codecs
font: can't open file: /root/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using Linux hardware RTC timing (1024Hz).
Can't open input config file /root/.mplayer/input.conf : No such file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf : No such file or directory
Falling back on default (hardcoded) input config

Playing Panama.wma
ASF file format detected.
Clip info:
name: Panama
author: Van Halen
copyright: Copyright (c) (p) 2001 Warner Bros. Label. All rights reserved.
comments: Not Available
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 16002->176400 (128.0 kbit)
Selected audio codec: [ffwmav2] afm:ffmpeg (DivX audio v2 (ffmpeg))
==========================================================================
Checking audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 44100 hz, little endian signed int
AF_pre: 44100Hz 2ch Signed 16-bit (Little-Endian)
PCM: File: Panama.wav (WAVE)
PCM: Samplerate: 44100Hz Channels: Stereo Format Signed 16-bit (Little-Endian)
PCM: Info: fastest dumping is achieved with -vc null -vo null
PCM: Info: to write WAVE files use -waveheader (default); for RAW PCM -nowaveheader.
AO: [pcm] 44100Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
Video: no video
Starting playback...
A: -0.0 0.0% 0%

Exiting... (End of file)


It created a little wav file which didn't play on anything. Any help ( and please make it easy, this is my first time and I do not know what I am doing ) would be very much appreciated. Thanks.

Jim
jimmmac is offline     Reply With Quote
Old 11-11-2003, 12:35 PM   #17
mikenac
LQ Newbie
 
Registered: Nov 2003
Distribution: Mandrake 9.2, Redhat 9.0, FreeBSD 5.1
Posts: 8
Thanked: 0
My 2 cents... Ravnx, took your script and added some recursion, etc.

#!/usr/bin/perl -w
use strict;
use File::Find;

print "Starting Conversion\n";

my $rootdir = $ARGV[0]; #Root directory
my @files;

(-d $rootdir) or die "Invalid Root Directory\n";

find (\&parse, $rootdir);

foreach my $file (@files)
{
my $base= $file; $base =~ s/\.wma$//i;
system "mplayer \"$file\" -ao pcm -aofile \"$base.wav\"";
system "lame -h \"$base.wav\" \"$base.mp3\"";
unlink("$base.wav");
print "$base.wma converted to mp3.\n";
}

print "Conversion Finished";


sub parse
{
my $raw = $File::Find::name;
if ($raw =~ m/\.wma$/i)
{
push (@files, $File::Find::name);
}
}

Last edited by mikenac; 11-11-2003 at 12:40 PM..
mikenac is offline     Reply With Quote
Old 12-08-2003, 02:30 AM   #18
mhacleth
LQ Newbie
 
Registered: Nov 2003
Location: Philippines
Distribution: Fedora Core 1 (Yarrow)
Posts: 1
Thanked: 0
Jimmmac,
THis happened to me too. I can't play wma files that is converted in Windows Media Player 9 with protected content. I guess the wma files that you have is protected.
mhacleth is offline     Reply With Quote
Old 06-17-2004, 12:40 AM   #19
Kleedrac
Member
 
Registered: Apr 2004
Location: Saskatoon SK. CA
Distribution: Ubuntu Dapper
Posts: 50
Thanked: 0
Is there a way to convert protected .wma's? In Canada, McDonalds started a free song promo from connect.com. Unfortunately all they offer is protected .wma's which I would much rather have in a better format like .ogg or .mp3. Any ideas?

Kleed
Kleedrac is offline     Reply With Quote
Old 06-26-2004, 07:18 AM   #20
jimmmac
Member
 
Registered: Oct 2002
Location: Florida
Distribution: RedHat
Posts: 109
Thanked: 0
Hi Kleedrac

I found a way around it all after I made this post. I just cut whatever I have to a music Cd. Then I copy them in Linux back to a directory and tell it to make it an .ogg format. It doesn't matter if it is protected or not. I then can do what I want with it. Does that make sense?

Jimmmac
jimmmac is offline     Reply With Quote
Old 07-20-2004, 04:41 PM   #21
jsjohnst
LQ Newbie
 
Registered: Oct 2003
Location: Kansas
Distribution: Mandrake 10 Official
Posts: 11
Thanked: 0
Here's a way to do the single line command with directory recursion:

Ogg Encoding:
Code:
for i in `find . -name "*.wma"` ;do mplayer -ao pcm -aofile "${i%.wma}.wav" "$i"; oggenc "${i%.wma}.wav"; rm "${i%.wma}.wav"; done
MP3 Encoding:
Code:
for i in `find . -name "*.wma"` ;do mplayer -ao pcm -aofile "${i%.wma}.wav" "$i"; lame -h "${i%.wma}.wav" "${i%.wma}.mp3"; rm "${i%.wma}.wav"; done
The above will convert every wma in the directory your currently in and every subdirectory below it. Both those command must be done in a bash shell if memory serves. I don't think it works with (t)csh or korn shells.

Last edited by jsjohnst; 07-20-2004 at 04:43 PM..
jsjohnst is offline  
Tag This Post
Reply With Quote
Old 07-27-2004, 07:09 AM   #22
jeb083079
LQ Newbie
 
Registered: Jul 2004
Distribution: Fedora Core, Red Hat
Posts: 18
Thanked: 0
how do i convert audio songs to mp3??? what software will i use???
jeb083079 is offline     Reply With Quote
Old 07-27-2004, 09:54 PM   #23
degraffenried13
Member
 
Registered: Sep 2003
Posts: 228
Thanked: 0
Quote:
Originally posted by jimmmac
Hi Kleedrac

I found a way around it all after I made this post. I just cut whatever I have to a music Cd. Then I copy them in Linux back to a directory and tell it to make it an .ogg format. It doesn't matter if it is protected or not. I then can do what I want with it. Does that make sense?

Jimmmac
what program in linux did you use to burn the CD? the one I have xcdroast will only burn wav files.
degraffenried13 is offline     Reply With Quote
Old 03-24-2005, 10:54 PM   #24
lokee
Member
 
Registered: Feb 2003
Distribution: Gentoo
Posts: 381
Thanked: 0
Hi,
Just my 2cents. smc_one for most people, your script doesn't work.
The reason is simple: most people have their mplayer loop forever by default...

Here's the correction to make:
Replace
Code:
 mplayer ${FILENAME}.wma -ao pcm -aofile '${FILENAME}.wav'
With:
Code:
mplayer ${FILENAME}.mpeg -loop 1 -ao pcm -aofile '${FILENAME}.wav'
Hope this helps
lokee is offline     Reply With Quote
Old 03-25-2005, 06:10 AM   #25
jimmmac
Member
 
Registered: Oct 2002
Location: Florida
Distribution: RedHat
Posts: 109
Thanked: 0
Hi degraffenried13

I use Xandros, so I either used the Xandros file manager. I did have k3b, but can't remember if I used that. Have a great day.

Jim
jimmmac is offline     Reply With Quote
Old 12-21-2005, 07:01 PM   #26
imrkelly
LQ Newbie
 
Registered: Dec 2005
Posts: 2
Thanked: 0
Oh, I have no idea what any of this means! Haha I'm sorry. Okay, here's what I wanted to do. I wanted to make an artist page on myspace, and in order to upload songs, they have to be in mp3 form. The artist page is dedicated to R.E.M., and I wanted to take the songs from my wma playlist and convert them to mp3. If any of you have the patience, could you email me at rita_kelly48@hotmail.com and explain what must be done.. I would really appreciate it because I have no idea what these codes are, where they are placed, etc. Thanks.
imrkelly is offline     Reply With Quote
Old 12-21-2005, 07:42 PM   #27
jimmmac
Member
 
Registered: Oct 2002
Location: Florida
Distribution: RedHat
Posts: 109
Thanked: 0
Hi imrkelly

A newbie, GREAT! Welcome to Linux. I am a semi-newbie in the sense that I am not as bright as many of the people who write on this forum. I never got anywhere with Mplayer until I downloaded a deb file (file to install a program) from on of my other forums. But I did convert my ogg music files (a very good linux format) to mp3 files using a program called Audacity. I was able to install Audacity with Xandros. But then your question is : How do I get my playlist files (probably wma format) into ogg files or mp3 files? Here is where you can discover something that I did. Put a music cd into a computer CD drive, then browse the Cd with Xandros File Manager. You might discover something that I did that will be very helpful. I am hesitant to say much more, because I am not sure of the legalities of working with wma files. But I think in my post, you will find a lot of answers.

Jim
jimmmac is offline     Reply With Quote
Old 12-22-2005, 01:32 PM   #28
imrkelly
LQ Newbie
 
Registered: Dec 2005
Posts: 2
Thanked: 0
Thanks!
imrkelly is offline     Reply With Quote
Old 01-14-2006, 06:00 PM   #29
kevadams
LQ Newbie
 
Registered: Sep 2004
Posts: 1
Thanked: 0
Quote:
Originally Posted by ravnx
Interesting! I had done the same thing! See below.

#!/usr/bin/perl -w
use strict;

foreach my $file (@ARGV) {
next if ($file !~ /\.wma$/i);
my $base = $file; $base =~ s/\.wma$//i;
system "mplayer \"$file\" -ao pcm -aofile \"$base.wav\"";
system "lame -h \"$base.wav\" \"$base.mp3\"";
unlink("$base.wav");
print "$base.wma converted to mp3.\n";
}
Hi folks

I know this is an old thread but it just helped me out and I thought I'd update the script - the line :
Quote:
Originally Posted by ravnx
system "mplayer \"$file\" -ao pcm -aofile \"$base.wav\"";
gave a 'deprecated' error with my later version of mplayer
so I changed it to
system "mplayer \"$file\" -ao pcm:file=\"$base.wav\"";
and it worked a treat
cheers
kev

Last edited by kevadams; 01-14-2006 at 07:14 PM..
kevadams is offline     Reply With Quote
Old 03-25-2006, 07:04 AM   #30
capo
LQ Newbie
 
Registered: Mar 2006
Posts: 1
Thanked: 0
well i couldn'tget any of those scripts to work for me, i to got that depreciated erro, but upon fixing that the second shorter perl script just does nothing, and all the other sripts bash and perl, and just the command all jsut say they cant find the file over and over again and do nothing.

FC5
2.6.16.2071
capo is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: Convert WMA to MP3 cadj LinuxAnswers Discussion 78 11-14-2009 07:09 PM
Convert wma to ogg lixy Linux - Software 13 07-19-2008 01:45 AM
Wma to Mp3 Knowledgements Slackware 23 09-23-2006 10:07 AM
Any program that can convert mp3 files to wma? josh_hd_new Linux - Newbie 1 01-21-2005 03:03 AM
how to convert a wma to mp3?? yenonn Linux - General 2 04-26-2004 08:25 PM


All times are GMT -5. The time now is 06:28 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration