<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.tinkernet.ca/index.php?action=history&amp;feed=atom&amp;title=Linux_-_Convert_to_mp3</id>
	<title>Linux - Convert to mp3 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tinkernet.ca/index.php?action=history&amp;feed=atom&amp;title=Linux_-_Convert_to_mp3"/>
	<link rel="alternate" type="text/html" href="https://wiki.tinkernet.ca/index.php?title=Linux_-_Convert_to_mp3&amp;action=history"/>
	<updated>2026-04-21T12:12:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.tinkernet.ca/index.php?title=Linux_-_Convert_to_mp3&amp;diff=478&amp;oldid=prev</id>
		<title>Tinker: Created page with &quot;&lt;div class=&quot;post-text&quot;&gt; == flac to mp3 ==  From [https://askubuntu.com/questions/385636/what-is-the-proper-way-to-convert-flac-files-to-320-kbit-sec-mp3 Ask Ubuntu]  First of...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.tinkernet.ca/index.php?title=Linux_-_Convert_to_mp3&amp;diff=478&amp;oldid=prev"/>
		<updated>2020-07-01T03:57:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;div class=&amp;quot;post-text&amp;quot;&amp;gt; == flac to mp3 ==  From [https://askubuntu.com/questions/385636/what-is-the-proper-way-to-convert-flac-files-to-320-kbit-sec-mp3 Ask Ubuntu]  First of...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;post-text&amp;quot;&amp;gt;&lt;br /&gt;
== flac to mp3 ==&lt;br /&gt;
&lt;br /&gt;
From [https://askubuntu.com/questions/385636/what-is-the-proper-way-to-convert-flac-files-to-320-kbit-sec-mp3 Ask Ubuntu]&lt;br /&gt;
&lt;br /&gt;
First of all you must make sure that it's installed.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get install libav-tools&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should have lame and flac codecs, now is just create a bash script to finish the job:&lt;br /&gt;
&amp;lt;pre&amp;gt;cat &amp;gt; flac2mp3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the shell will wait for your commands, copy and paste this:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lang-bsh prettyprint prettyprinted&amp;quot; style=&amp;quot;&amp;quot;&amp;gt;#!/bin/bash&lt;br /&gt;
[[ $# == 0 ]] &amp;amp;&amp;amp; set -- *.flac&lt;br /&gt;
   for f; do&lt;br /&gt;
  avconv -i &amp;quot;$f&amp;quot; -qscale:a 0 &amp;quot;${f[@]/%flac/mp3}&amp;quot;&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now press &amp;lt;kbd&amp;gt;Ctrl&amp;lt;/kbd&amp;gt; + &amp;lt;kbd&amp;gt;D&amp;lt;/kbd&amp;gt;. Make your script executable &amp;lt;code&amp;gt;chmod +x flac2mp3&amp;lt;/code&amp;gt;. Now go you can use it like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;./flac2mp3 /path/with/all/my/flacs/*.flac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also copy the script to somewhere in your &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory with the flacs and execute it.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
With regards to the following parameter used above:&lt;br /&gt;
&amp;lt;pre&amp;gt;-qscale:a 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will not actually give you a exact ''320k'' file, although it is probably the best setting to use anyway. The suggested settings actually give a target bitrate of 245 kbits/s with a range of 220-260. If you really wanted 320k mp3s you would have to go to CBR and use:&lt;br /&gt;
&amp;lt;pre&amp;gt;-c:a libmp3lame -b:a 320k&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but you would need great ears to notice the difference...&lt;br /&gt;
&lt;br /&gt;
Reference:&lt;br /&gt;
&lt;br /&gt;
*[https://wiki.archlinux.org/index.php/Convert_Flac_to_Mp3#With_FFmpeg https://wiki.archlinux.org/index.php/Convert_Flac_to_Mp3#With_FFmpeg] &lt;br /&gt;
&lt;br /&gt;
== m4a to mp3 ==&lt;br /&gt;
&lt;br /&gt;
Fuck me...&lt;br /&gt;
&lt;br /&gt;
Copy the flac2mp3 script &amp;amp; just change &amp;quot;flac&amp;quot; to &amp;quot;m4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Seems to work just fine.&lt;br /&gt;
&lt;br /&gt;
from [https://unix.stackexchange.com/questions/438927/convert-all-found-m4a-to-mp3 StackExchange]&lt;br /&gt;
&lt;br /&gt;
(Doesn't actually work... but some ideas to think about in it...)&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/bash&lt;br /&gt;
## jc 2016&lt;br /&gt;
## convert [m4a mp3 wma] to mp3 128k&lt;br /&gt;
## [-vn] disable video recording&lt;br /&gt;
##&lt;br /&gt;
## avconv with lame mp3 plugin&lt;br /&gt;
## [-acodec libmp3lame]&lt;br /&gt;
##&lt;br /&gt;
## 192 k constant bitrate&lt;br /&gt;
## [-ab 192k]&lt;br /&gt;
## [-ab 128k]&lt;br /&gt;
##&lt;br /&gt;
## 44.1kHz sampling rate&lt;br /&gt;
## [-ar 44100]&lt;br /&gt;
##&lt;br /&gt;
## 2 channel audio&lt;br /&gt;
## [-ac 2]&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
##  force the shell to do a case insensitive comparison&lt;br /&gt;
shopt -s nocasematch&lt;br /&gt;
&lt;br /&gt;
working_directory=&amp;quot;./mp3_converted&amp;quot;&lt;br /&gt;
# check if dir exist&lt;br /&gt;
if [&amp;amp;nbsp;! -d &amp;quot;$working_directory&amp;quot; ];&lt;br /&gt;
then&lt;br /&gt;
  # dir does not exist&lt;br /&gt;
      echo &amp;quot;convert directory does not exist $working_directory...&amp;quot;&lt;br /&gt;
  `mkdir -p &amp;quot;$working_directory&amp;quot;`&lt;br /&gt;
       echo &amp;quot;convert directory created $working_directory...&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
COUNT=0&lt;br /&gt;
&lt;br /&gt;
for i in *; do&lt;br /&gt;
&lt;br /&gt;
  case $i in&lt;br /&gt;
    *.mp3)&lt;br /&gt;
      avconv -analyzeduration 999999999 -map_metadata 0 -i &amp;quot;$i&amp;quot; -vn -acodec libmp3lame -ac 2 -ab 128k -ar 44100 &amp;quot;$working_directory/`basename &amp;quot;$i&amp;quot; .mp3`.mp3&amp;quot;&lt;br /&gt;
      echo $i&lt;br /&gt;
     &amp;amp;nbsp;;;&lt;br /&gt;
    *.m4a)&lt;br /&gt;
      ##avconv -analyzeduration 999999999 -map_metadata 0 -i &amp;quot;$i&amp;quot; -vn -acodec libmp3lame -ac 2 -ab 128k -ar 44100 &amp;quot;$working_directory/`basename &amp;quot;$i&amp;quot; .m4a`.mp3&amp;quot;&lt;br /&gt;
      # adjusted for ffmpeg to test.&lt;br /&gt;
      ffmpeg -i &amp;quot;$i&amp;quot; -n -acodec libmp3lame -ab 128k &amp;quot;$working_directory/`basename &amp;quot;$i&amp;quot; .m4a`.mp3&amp;quot;&lt;br /&gt;
      echo $i&lt;br /&gt;
     &amp;amp;nbsp;;;&lt;br /&gt;
    *.wma)&lt;br /&gt;
      avconv -analyzeduration 999999999 -map_metadata 0 -i &amp;quot;$i&amp;quot; -vn -acodec libmp3lame -ac 2 -ab 128k -ar 44100 &amp;quot;$working_directory/`basename &amp;quot;$i&amp;quot; .wma`.mp3&amp;quot;&lt;br /&gt;
      echo $i&lt;br /&gt;
     &amp;amp;nbsp;;;&lt;br /&gt;
    *)&lt;br /&gt;
      echo &amp;quot;other&amp;quot;&lt;br /&gt;
     &amp;amp;nbsp;;;&lt;br /&gt;
  esac&lt;br /&gt;
&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
## back to normal comparison&lt;br /&gt;
shopt -u nocasematch&lt;br /&gt;
exit 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tinker</name></author>
		
	</entry>
</feed>