{"id":19,"date":"2021-06-08T10:00:54","date_gmt":"2021-06-08T00:00:54","guid":{"rendered":"http:\/\/localhost:8000\/?p=19"},"modified":"2021-06-08T10:00:54","modified_gmt":"2021-06-08T00:00:54","slug":"vlc-how-to-equalise-stream","status":"publish","type":"post","link":"http:\/\/www.cheerfulprogramming.com\/?p=19","title":{"rendered":"VLC How To Equalise Stream"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Suppose you have some music on a CD or an online streaming source that you want to copy to your computer for personal listening.  <em>Do not infringe copyright by pirating music and sharing it!<\/em>  There are many tools to do this including VLC.  What&#8217;s not very clear in VLC is how to rebalance the bass and the treble in the music during the streaming process, if say the bass was a bit soft and you wanted to give it a boost.  This article tells you how to do that and introduces a simple Bash script to facilitate ripping your CD collection.  This article assumes a Linux-type environment, but Windows users should be able to adapt the commands to Windows with a little bit of research.<\/p>\n<h2>The VLC Graphical Equaliser<\/h2>\n<p>Play your CD and adjust the equaliser settings in the VLC equaliser until your mix is satisfactory.  Find this by pressing <code class=\"\" data-line=\"\">Ctrl+E<\/code> or going to the Tools menu -&gt; Effects and Filters.  When you have found the equaliser settings that you want, such as is shown in the screenshot below, the question is: how do you translate these into a command that will work when you stream the file?  It is not simple enough to save these settings, quit VLC, then run a script, since that will not work.  When you have found the settings you want, write down on the numbers for the Preamp and the frequency bands, including those you left at 0, and get ready to use them on the command line.<\/p>\n<p><img decoding=\"async\" alt=\"VLC Graphical Equaliser\" src=\"\/wp-content\/uploads\/2023\/06\/VLC_equaliser_screenshot.png\" fluid\/><\/p>\n<h2>The VLC Command Line Equaliser<\/h2>\n<p>Here is an example of how to invoke VLC from the command line to equalise a stream to a file called <code class=\"\" data-line=\"\">1.wav<\/code>.  VLC is capable of saving to compressed formats such as <code class=\"\" data-line=\"\">.mp3<\/code> and <code class=\"\" data-line=\"\">.m4a<\/code>, however there are other free tools that can do that also, and which provide convenient ways to set the data tags.  This example streams from a CD but VLC can accept other input sources.<\/p>\n<p>The three most important options to note are the <code class=\"\" data-line=\"\">--equalizer-preamp<\/code>, the <code class=\"\" data-line=\"\">--equalizer-bands<\/code>, which has ten numbers (integers or decimals) separated by spaces, and the <code class=\"\" data-line=\"\">--sout<\/code> option, which contains the essential <code class=\"\" data-line=\"\">afilter=equalizer<\/code> argument, which actually inserts your equaliser settings into the transcoding chain.  Without this last option your equaliser settings will be ineffective.<\/p>\n<pre><code class=\"\" data-line=\"\">vlc -I dummy cdda:\/\/\/dev\/cdrom \\\n  --cdda-track=1 \\\n  --equalizer-preamp=15.0 \\\n  --equalizer-bands=&quot;12 9 5.5 0 0 0 0 0 0 0&quot; \\\n  --sout=#transcode\\{afilter=equalizer,acodec=s16l,channels=2,ab=128,samplerate=44100\\}:standard\\{access=file,mux=wav,dst=&quot;1.wav&quot;\\} \\\n  vlc:\/\/quit<\/code><\/pre>\n<h2>Converting a whole disk<\/h2>\n<p>Now that you have the example command, let&#8217;s put the command into a script so that you can conveniently convert a whole CD without a lot of retyping.  We will parameterise the track number and the name of the output file, but not the equaliser settings.  If you need custom equaliser settings for every track, then by adapting this example you can parameterise the equaliser also.  This script uses the FAAC encoder to save the <code class=\"\" data-line=\"\">.wav<\/code> file to <code class=\"\" data-line=\"\">.m4a<\/code>.<\/p>\n<pre><code class=\"\" data-line=\"\">#!\/bin\/bash\nalbum=&quot;The title of the album&quot;\nartist=&quot;The default name of the artist, band, orchestra, etc&quot;\nfunction ripIt() {\n    local index=$1;\n    local title=$2;\n    local artist=${3:-${artist}};\n    local album=${album};\n    vlc -I dummy cdda:\/\/\/dev\/cdrom \\\n      --cdda-track=${index} \\\n      --equalizer-preamp=15.0 \\\n      --equalizer-bands=&quot;12 9 5.5 0 0 0 0 0 0 0&quot; \\\n      --sout=#transcode\\{afilter=equalizer,acodec=s16l,channels=2,ab=128,samplerate=44100\\}:standard\\{access=file,mux=wav,dst=&quot;${index}.wav&quot;\\} \\\n      vlc:\/\/quit\n    faac -b 128 --joint=1 \\\n      --artist=&quot;${artist}&quot; \\\n      --title=&quot;${title}&quot; \\\n      --track=&quot;${index}&quot; \\\n      --album=&quot;${album}&quot; \\\n      &quot;${index}.wav&quot; \\\n      -o &quot;${title}.m4a&quot;\n\n    rm &quot;${index}.wav&quot;\n}\n\nripIt 1 &quot;Title of first track&quot;\nripIt 2 &quot;Title of second track&quot; &quot;Optional artist name overrides the default&quot;\nripIt 3 &quot;Title of third track&quot;\nripIt 4 &quot;Title of fourth track&quot;\n...<\/code><\/pre>\n<p>That&#8217;s it!  In the example above I added line breaks for clarity; if you get errors then you might need to remove them.<\/p>\n<h2>Acknowledgements<\/h2>\n<p>The author acknowledges the traditional custodians of the Daruk and the<br \/>\nEora People and pays respect to the Elders past and present.<\/p>\n<p>VLC\u00ae is a registered trademark of the VideoLAN non-profit organisation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Suppose you have some music on a CD or an online streaming source that you want to copy to your computer for personal listening. Do not infringe copyright by pirating music and sharing it! There are many tools to do this including VLC. What&#8217;s not very clear in VLC is how to rebalance the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":31,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[14,21],"class_list":["post-19","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vlc","tag-m4a","tag-vlc"],"_links":{"self":[{"href":"http:\/\/www.cheerfulprogramming.com\/index.php?rest_route=\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.cheerfulprogramming.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.cheerfulprogramming.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.cheerfulprogramming.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.cheerfulprogramming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19"}],"version-history":[{"count":0,"href":"http:\/\/www.cheerfulprogramming.com\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.cheerfulprogramming.com\/index.php?rest_route=\/wp\/v2\/media\/31"}],"wp:attachment":[{"href":"http:\/\/www.cheerfulprogramming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.cheerfulprogramming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.cheerfulprogramming.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}