snipt

Ctrl+h for KB shortcuts

Bash

convert audio files (e.g. m4a) to ogg vorbis

1
2
3
4
5
#!/bin/bash

for i in "[email protected]"; do
  ffmpeg -i "$i" -acodec vorbis -ac 2 ${i%.*}.ogg
done
https://snipt.net/embed/d135a9ad1d04f6d13747598d3b272ebb/
/raw/d135a9ad1d04f6d13747598d3b272ebb/
d135a9ad1d04f6d13747598d3b272ebb
bash
Bash
6
2019-08-23T16:53:51
True
False
False
/api/public/snipt/10087/
convert-audio-files-eg-m4a-to-ogg-vorbis
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="ch">#!/bin/bash</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="k">for</span> i in <span class="s2">&quot;</span><span class="nv">[email protected]</span><span class="s2">&quot;</span><span class="p">;</span> <span class="k">do</span> </span><span id="L-4"><a name="L-4"></a> ffmpeg -i <span class="s2">&quot;</span><span class="nv">$i</span><span class="s2">&quot;</span> -acodec vorbis -ac <span class="m">2</span> <span class="si">${</span><span class="nv">i</span><span class="p">%.*</span><span class="si">}</span>.ogg </span><span id="L-5"><a name="L-5"></a><span class="k">done</span> </span></pre></div> </td></tr></table>
convert, ffmpeg, m4a, ogg