SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309
Rep:
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
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.
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618
Rep:
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.
@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).
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
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:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.