LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-14-2019, 05:48 PM   #1
TarFile
Member
 
Registered: Mar 2003
Posts: 371

Rep: Reputation: 37
Question convert wma files to mp3 files


Is there an easy way to do this? Maybe with the standard Slack install I think VLC may do this but its kind of a pain to install with all the dependencies. I am slowly doing that on a, I hope 14.2 partition but that's going to take a while. I would like to be able to do a directory with sub directories from the command line. In other words convert all the wma files to mp3 files.

Is this possible?

I did some google searches and searched the forum here but did not really find what I wanted.
 
Old 06-14-2019, 06:07 PM   #2
magicm
Member
 
Registered: May 2003
Distribution: Slackware
Posts: 237

Rep: Reputation: 152Reputation: 152
I'd suggest lame and/or audacity - both found on SBo
 
Old 06-14-2019, 06:34 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
ffmpg: https://www.howtoforge.com/tutorial/...io-conversion/
 
Old 06-14-2019, 06:58 PM   #4
slacktroll
Member
 
Registered: May 2011
Distribution: Slackware64/current
Posts: 175

Rep: Reputation: 44
ffmpeg -i input.wma -f wav - | lame - -V0 output.mp3

a little bash script can take *wma and encode filename.wma to filename.mp3
 
1 members found this post helpful.
Old 06-14-2019, 09:19 PM   #5
mrapathy
Member
 
Registered: Nov 2005
Distribution: Slackware,Debian
Posts: 366

Rep: Reputation: 66
get VLC2 txz package from Alien Bob. I have tried building VLC from sbo which has a ton of deps and will take forever.
 
Old 06-14-2019, 10:10 PM   #6
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309

Rep: Reputation: 234Reputation: 234Reputation: 234
Just try my musica script using wma2mp3 option.

musica
Code:
#!/bin/bash

# musica 1.3: converts from and to different audio formats
# Copyright (C) 2006-2019 Cezary M. Kruk <cezary.kruk@poczta.wp.pl>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

#
# CONFIGURATION SECTION BEGINS HERE
#

flac_compression="-5"
lame_bitrate="--r3mix -m s"
ogg_bitrate="-q 7.5"

#
# CONFIGURATION SECTION ENDS HERE
#

function testpath()
{
    if [ "`which $1 2> /dev/null`" == "" ]
    then
        echo "There is no $1 program in the path."
        if [ "$1" == "oggenc" ]
        then
            echo "Install vorbis-tools package."
        elif [ "$1" == "mac" ]
        then
            echo "Install mac package..."
            echo "See: https://web.archive.org/web/20120529111247/http://supermmx.org/linux/mac"
        elif [ "$1" == "sox" ]
        then
            echo "Install sox package and libsox-fmt-mp3 library if required."
        elif [ "$1" == "faad" ]
        then
            echo "Install faad2 or faad package."
        elif [ "$1" == "mpg321" ]
        then
            echo "Install mpg123 package."
        elif [ "$1" == "mpcdec" ]
        then
            echo "Install musepack-tools package."
        else
            echo "Install $1 package."
        fi
        exit
    fi
}

testpath lame
testpath oggenc
testpath flac

ape2flac()
{
    testpath mac
    for file in *.ape
    do
        mac "$file" - -d | flac $flac_compression - -o "${file%ape}flac"
    done
}

ape2mp3()
{
    testpath mac
    for file in *.ape
    do
        mac "$file" - -d | lame $lame_bitrate - "${file%ape}mp3"
    done
}

ape2ogg()
{
    testpath mac
    for file in *.ape
    do
        mac "$file" - -d | oggenc $ogg_bitrate -o "${file%ape}ogg" -
    done
}

ape2wav()
{
    testpath mac
    for file in *.ape
    do
        mac "$file" "${file%ape}wav" -d
    done
}

flac2flac()
{
    for file in *.flac
    do
        flac -d -c "$file" | flac $flac_compression - -o "$file.flac"
    done
}

flac2mp3()
{
    for file in *.flac
    do
        flac -d -c "$file" | lame $lame_bitrate - "${file%flac}mp3"
    done
}

flac2ogg()
{
    for file in *.flac
    do
        flac -d -c "$file" | oggenc $ogg_bitrate -o "${file%flac}ogg" -
    done
}

flac2wav()
{
    testpath sox
    for file in *.flac
    do
        flac -d -c "$file" | sox -t wav - "${file%flac}wav"
    done
}

m4a2flac()
{
    testpath ffmpeg
    for file in *.m4a
    do
        ffmpeg -y -i "$file" -acodec flac "${file%m4a}flac"
    done
}

m4a2mp3()
{
    testpath faad
    for file in *.m4a
    do
        faad -o - "$file" | lame $lame_bitrate - "${file%m4a}mp3"
    done
}

m4a2ogg()
{
    testpath faad
    for file in *.m4a
    do
        faad -o - "$file" | oggenc $ogg_bitrate -o "${file%m4a}ogg" -
    done
}

m4a2wav()
{
    testpath faad
    for file in *.m4a
    do
        faad -o "${file%m4a}wav" "$file"
    done
}

mp32flac()
{
    testpath sox
    for file in *.mp3
    do
        sox "$file" -t wav - | flac $flac_compression - -o "${file%mp3}flac"
    done
}

mp32mp3()
{
    testpath sox
    for file in *.mp3
    do
        sox "$file" -t wav - | lame $lame_bitrate - "$file.mp3"
    done
}

mp32ogg()
{
    testpath sox
    for file in *.mp3
    do
        sox "$file" -t wav - | oggenc $ogg_bitrate -o "${file%mp3}ogg" -
    done
}

mp32wav()
{
    testpath mpg321
    testpath sox
    for file in *.mp3
    do
        sox "$file" -t wav "${file%mp3}wav"
    done
}

mpc2flac()
{
    testpath mpcdec
    for file in *.mpc
    do
        mpcdec "$file" - | flac $flac_compression - -o "${file%mpc}flac"
    done
}

mpc2mp3()
{
    testpath mpcdec
    for file in *.mpc
    do
        mpcdec "$file" - | lame $lame_bitrate - "${file%mpc}mp3"
    done
}

mpc2ogg()
{
    testpath mpcdec
    for file in *.mpc
    do
        mpcdec "$file" - | oggenc $ogg_bitrate -o "${file%mpc}ogg" -
    done
}

mpc2wav()
{
    testpath mpcdec
    testpath sox
    for file in *.mpc
    do
        mpcdec "$file" - | sox -t wav - "${file%mpc}wav"
    done
}

ogg2flac()
{
    testpath sox
    for file in *.ogg
    do
        sox "$file" -t wav - | flac $flac_compression - -o "${file%ogg}flac"
    done
}

ogg2mp3()
{
    testpath sox
    for file in *.ogg
    do
        sox "$file" -t wav - | lame $lame_bitrate - "${file%ogg}mp3"
    done
}

ogg2ogg()
{
    testpath sox
    for file in *.ogg
    do
        sox "$file" -t wav - | oggenc $ogg_bitrate -o "$file.ogg" -
    done
}

ogg2wav()
{
    testpath sox
    for file in *.ogg
    do
        sox "$file" -t wav "${file%ogg}wav"
    done
}

wav2flac()
{
    for file in *.wav
    do
        flac $flac_compression "$file" -o "${file%wav}flac"
    done
}

wav2mp3()
{
    for file in *.wav
    do
        lame $lame_bitrate "$file" "${file%wav}mp3"
    done
}

wav2ogg()
{
    for file in *.wav
    do
        oggenc $ogg_bitrate -o "${file%wav}ogg" "$file"
    done
}

wav2wav()
{
    testpath sox
    for file in *.wav
    do
        sox "$file" -b 16 -t wav - channels 2 rate 44.1k | sox -t wav - "$file.wav"
    done
}

wma2flac_old()
{
    testpath mplayer
    for file in *.wma
    do
        mplayer -ao pcm:file="${file%wma}wav" "$file"
    done
    for file in *.wav
    do
        flac $flac_compression "$file" -o "${file%wav}flac"
    done
}

wma2mp3_old()
{
    testpath mplayer
    for file in *.wma
    do
        mplayer -ao pcm:file="${file%wma}wav" "$file"
    done
    for file in *.wav
    do
        lame $lame_bitrate "$file" "${file%wav}mp3"
    done
}

wma2ogg_old()
{
    testpath mplayer
    for file in *.wma
    do
        mplayer -ao pcm:file="${file%wma}wav" "$file"
    done
    for file in *.wav
    do
        oggenc $ogg_bitrate -o "${file%wav}ogg" "$file"
    done
}

wma2wav()
{
    testpath mplayer
    for file in *.wma
    do
        mplayer -ao pcm:file="${file%wma}wav" "$file"
    done
}

wma2flac()
{
    testpath mplayer
    mkfifo fifo
    for file in *.wma
    do
        mplayer -ao pcm:file=fifo "$file" | flac $flac_compression fifo -o "${file%wma}flac"
    done
    rm fifo
}

wma2mp3()
{
    testpath mplayer
    mkfifo fifo
    for file in *.wma
    do
        mplayer -ao pcm:file=fifo "$file" | lame $lame_bitrate fifo "${file%wma}mp3"
    done
    rm fifo
}

wma2ogg()
{
    testpath mplayer
    mkfifo fifo
    for file in *.wma
    do
        mplayer -ao pcm:file=fifo "$file" | oggenc $ogg_bitrate -o "${file%wma}ogg" fifo
    done
    rm fifo
}

wma2wav_new()
{
    testpath mplayer
    testpath sox
    mkfifo fifo
    for file in *.wma
    do
        mplayer -ao pcm:file=fifo "$file" | sox -t wav fifo "${file%wma}wav"
    done
    rm fifo
}

avi2mp3()
{
    testpath ffmpeg
    for file in *.avi
    do
        ffmpeg -i "$file" -vn -acodec mp3 "${file%avi}mp3"
    done
}

mkv2m4a()
{
    testpath ffmpeg
    for file in *.mkv
    do
        ffmpeg -i "$file" -vn -acodec copy -codec:a aac -bsf:a aac_adtstoasc "${file%mkv}m4a"
    done
}

mp42m4a()
{
    testpath ffmpeg
    for file in *.mp4
    do
        ffmpeg -i "$file" -vn -acodec copy "${file%mp4}m4a"
    done
}

help="yes"
for converter in  ape2flac     ape2mp3     ape2ogg     ape2wav     \
                 flac2flac    flac2mp3    flac2ogg    flac2wav     \
                  m4a2flac     m4a2mp3     m4a2ogg     m4a2wav     \
                  mp32flac     mp32mp3     mp32ogg     mp32wav     \
                  mpc2flac     mpc2mp3     mpc2ogg     mpc2wav     \
                  ogg2flac     ogg2mp3     ogg2ogg     ogg2wav     \
                  wav2flac     wav2mp3     wav2ogg     wav2wav     \
                  wma2flac     wma2mp3     wma2ogg     wma2wav     \
                  wma2flac_old wma2mp3_old wma2ogg_old wma2wav_new \
                  avi2mp3      mkv2m4a     mp42m4a
do
    if [ "$1" == "$converter" ]
    then
        help="no"
    fi
done

if [ "$help" == "no" ]
then
    $1
    exit
else
    echo "musica: converts from and to different audio formats"
    echo
    echo "musica [ ape2flac  ape2mp3  ape2ogg  ape2wav  "
    echo "        flac2flac flac2mp3 flac2ogg flac2wav  "
    echo "         m4a2flac  m4a2mp3  m4a2ogg  m4a2wav  "
    echo "         mp32flac  mp32mp3  mp32ogg  mp32wav  "
    echo "         mpc2flac  mpc2mp3  mpc2ogg  mpc2wav  "
    echo "         ogg2flac  ogg2mp3  ogg2ogg  ogg2wav  "
    echo "         wav2flac  wav2mp3  wav2ogg  wav2wav  "
    echo "         wma2flac  wma2mp3  wma2ogg  wma2wav  "
    echo "                                              "
    echo "         avi2mp3   mkv2m4a  mp42m4a          ]"
    echo
fi
 
2 members found this post helpful.
Old 07-29-2021, 06:18 AM   #7
ChloePaterson
LQ Newbie
 
Registered: Jul 2021
Posts: 1

Rep: Reputation: Disabled
For sure, it is a problem. Any problem has a solution. For me also was hard to find a good website where I could convert files to MP3. Via Slack is complex, and the process takes a long time. After a lot of searching on the internet, on different platforms, I found coconvert.com. I use this website, and there I convert all the YouTube videos I need. It is very comfortable and easy to use. The process is also very rapid. You can try. I hope you will appreciate my recommendation. If I understood correctly, this is the solution to your issues.

Last edited by ChloePaterson; 08-03-2021 at 06:41 AM.
 
Old 07-29-2021, 07:22 AM   #8
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,405
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Just have a look at frankbell link. Or adapt the command line in the following post.

You could try 'man ffmpeg' as well and come back with a New thread to get help.
 
Old 07-31-2021, 05:20 AM   #9
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
PACPL is a fantastic little app that, unfortunately I haven't been able to get installed and working in the 'right-click' menu of anything 'Plasma'. On my 14.1 and 14.2 though, it has been the greatest little program to have handy I've ever had. With any luck, people who can program can figure out what it needed to get this to work again in Plasma, as I will miss it in the extreme.
 
Old 07-31-2021, 06:58 AM   #10
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,220

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
@TarFile, you are probably aware (and also might not care), but unless those files are WMA Lossless you would be going from lossy format (WMA) to lossy format (MP3), so that conversion would be losing more audio fidelity than is usual (compared say to converting from the original source to lossy just the one time).
 
1 members found this post helpful.
Old 07-31-2021, 09:54 AM   #11
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,138
Blog Entries: 6

Rep: Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827
As @drgibbon said. You'll be going from one lossy format to another. wma wasn't that great to begin with. And those files are probably 20 years old. So they are likely lower bitrate.

You may consider dumping them to pcm. The files will be much larger but you'll not loose more quality. Let me see. I think that I may have some old .wma files on a CDR from 22 years ago...

Code:
file abba2for1.wma
abba2for1.wma: Microsoft ASF ASF_Stream_Bitrate_Properties_Object

Input #0, asf, from 'abba2for1.wma':
  Metadata:
    WMFSDKVersion   : 7.00.00.1954
    WMFSDKNeeded    : 0.0.0.0000
    title           : Two For The Price Of One
    artist          : ABBA
    copyright       : <something>, a Universal Music Company
  Duration: 00:03:38.96, start: 0.000000, bitrate: 96 kb/s
  Stream #0:0: Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, 2 channels, fltp, 96 kb/s

Code:
mplayer abba2for1.wma -vc dummy -vo null -ao pcm:file=abba1.wav

file abba1.wav
abba1.wav: RIFF (little-endian) data, WAVE audio, IEEE Float, stereo 44100 Hz

ls -l abba1.wav
-rw-r--r-- 1 me me 77135916 Jul 31 09:44 abba1.wav
Huge, but you haven't lost any more quality.

Or

Code:
ffmpeg -i abba2for1.wma -vn -c:a pcm_s16le abba2.wav

file abba2.wav
abba2.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz

Input #0, wav, from 'abba2.wav':
  Metadata:
    artist          : ABBA
    copyright       : <something>, a Universal Music Company
    title           : Two For The Price Of One
    encoder         : Lavf58.76.100
  Duration: 00:03:38.96, bitrate: 1411 kb/s
  Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s
  
ls -l abba2.wav
-rw-r--r-- 1 me me 38625474 Jul 31 09:49 abba2.wav

Last edited by teckk; 07-31-2021 at 09:58 AM.
 
2 members found this post helpful.
Old 07-31-2021, 04:11 PM   #12
Lucko666
Member
 
Registered: Apr 2017
Location: Olympia WA
Distribution: Mint, Raspbian, Debian, elementaryOS, LinuxLite, Puppy, Manjaro, Armbian
Posts: 72

Rep: Reputation: Disabled
Another way is with the Gnome app SoundConverter (https://soundconverter.org/). This little GUI app is fast and effective, I find.
 
Old 08-03-2021, 12:23 AM   #13
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
At the risk of being entangled in a 'necromanced' thread I can add that FFmpeg now (late 2021) has decoders for all flavours of wma:

Code:
andrew@ilium~$ ffmpeg -hide_banner -codecs | grep wma
 D.AI.S wmalossless          Windows Media Audio Lossless
 D.AIL. wmapro               Windows Media Audio 9 Professional
 DEAIL. wmav1                Windows Media Audio 1
 DEAIL. wmav2                Windows Media Audio 2
 D.AIL. wmavoice             Windows Media Audio Voice
andrew@ilium~$
So a modern FFmpeg, or a modern application that uses FFmpeg libraries, is the perfect choice for any wma conversion...

And for those who are curious about the FFmpeg labeling:

Code:
Codecs:
 D..... = Decoding supported
 .E.... = Encoding supported
 ..V... = Video codec
 ..A... = Audio codec
 ..S... = Subtitle codec
 ...I.. = Intra frame-only codec
 ....L. = Lossy compression
 .....S = Lossless compression
 -------
 
2 members found this post helpful.
  


Reply



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
How do I convert my wma music files to mp3 music files? Edwin Rogemana Linux - Software 4 02-28-2012 10:37 AM
convert wma > mp3? andrewlkho Linux - Software 31 08-20-2007 12:26 AM
Software to convert wma files to mp3 or ogg? Stevetgn Linux - Software 1 12-20-2005 10:33 AM
Any program that can convert mp3 files to wma? josh_hd_new Linux - Newbie 1 01-21-2005 02:03 AM
how to convert a wma to mp3?? yenonn Linux - General 2 04-26-2004 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:46 PM.

Main Menu
Advertisement
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
Twitter: @linuxquestions
Open Source Consulting | Domain Registration