<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.css?cache=2026-11-13T15:19:59+00:00" type="text/css"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<html:meta xmlns:html="http://www.w3.org/1999/xhtml" name="viewport" content="width=device-width" />
<channel>
	<title>flac &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/flac/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Tue, 18 Mar 2025 09:36:14 +0000</lastBuildDate>
	<language>en-GB</language>
	<copyright>© Terence Eden. 🄯 CC BY-SA. See https://shkspr.mobi/blog/copyright-and-copyleft/</copyright>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>flac &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Convert Surround Sound WAV albums to individual opus files]]></title>
		<link>https://shkspr.mobi/blog/2018/03/convert-surround-sound-wav-albums-to-individual-opus-files/</link>
					<comments>https://shkspr.mobi/blog/2018/03/convert-surround-sound-wav-albums-to-individual-opus-files/#respond</comments>
				<dc:creator><![CDATA[Terence Eden]]></dc:creator>
		<pubDate>Sun, 18 Mar 2018 18:38:16 +0000</pubDate>
		<category><![CDATA[audio]]></category><category><![CDATA[bash]]></category><category><![CDATA[flac]]></category><category><![CDATA[linux]]></category><category><![CDATA[opus]]></category>		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=29185</guid>

		
		<description>As ever, notes to myself.  This is a method to take a .wav and .cue and transform it into individual files. In this case, .opus.  Transform to .flac  FLAC is a good intermediary file format, especially for surround sound files.  avconv -i file.wav out.flac  Transform to .opus  An optional step if you want smaller files. Maximum quality for 6 channel audio.  opusenc --bitrate 4096 out.flac…</description>
			
		<content:encoded>&lt;p&gt;As ever, notes to myself.  This is a method to take a &lt;code&gt;.wav&lt;/code&gt; and &lt;code&gt;.cue&lt;/code&gt; and transform it into individual files. In this case, &lt;code&gt;.opus&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id="transform-to-flac"&gt;&lt;a href="https://shkspr.mobi/blog/2018/03/convert-surround-sound-wav-albums-to-individual-opus-files/#transform-to-flac"&gt;Transform to &lt;code&gt;.flac&lt;/code&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;FLAC is a good intermediary file format, especially for surround sound files.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;avconv -i file.wav out.flac&lt;/code&gt;&lt;/p&gt;

&lt;h3 id="transform-to-opus"&gt;&lt;a href="https://shkspr.mobi/blog/2018/03/convert-surround-sound-wav-albums-to-individual-opus-files/#transform-to-opus"&gt;Transform to &lt;code&gt;.opus&lt;/code&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;An optional step if you want smaller files.
Maximum quality for 6 channel audio.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;opusenc --bitrate 4096 out.flac out.opus&lt;/code&gt;&lt;/p&gt;

&lt;h3 id="create-an-mkv"&gt;&lt;a href="https://shkspr.mobi/blog/2018/03/convert-surround-sound-wav-albums-to-individual-opus-files/#create-an-mkv"&gt;Create an &lt;code&gt;.mkv&lt;/code&gt;&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Add to an MKV with all the chapter information.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkvmerge -o test.mkv --chapters file.cue out.opus&lt;/code&gt;&lt;/p&gt;

&lt;h3 id="split-to-individual-files"&gt;&lt;a href="https://shkspr.mobi/blog/2018/03/convert-surround-sound-wav-albums-to-individual-opus-files/#split-to-individual-files"&gt;Split to individual files&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Individual MKVs&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkvmerge test.mkv --split chapters:all -o track.mkv&lt;/code&gt;&lt;/p&gt;

&lt;h3 id="extract-the-audio"&gt;&lt;a href="https://shkspr.mobi/blog/2018/03/convert-surround-sound-wav-albums-to-individual-opus-files/#extract-the-audio"&gt;Extract the Audio&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;One at a time:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkvextract tracks "track-001.mkv" 0:"individual.opus"&lt;/code&gt;&lt;/p&gt;

&lt;h2 id="all-in-one-bash-script"&gt;&lt;a href="https://shkspr.mobi/blog/2018/03/convert-surround-sound-wav-albums-to-individual-opus-files/#all-in-one-bash-script"&gt;All-In-One  bash script&lt;/a&gt;&lt;/h2&gt;

&lt;pre&gt;&lt;code class="language-bash"&gt;#!/bin/bash
json=$(ffprobe -i "file.mkv" -print_format json -show_chapters -loglevel error)
count=$(echo $json | jq ".chapters | length" )

mkvmerge test.mkv -D -S --split chapters:all -o "%02d.mkv"

COUNTER=1
while [ $COUNTER -le $count ]; do

  printf -v zerotrack "%02d" $COUNTER

  json=$(ffprobe -i "$zerotrack.mkv" -print_format json -show_chapters -loglevel error)
  title=$(echo $json | jq ".chapters[0].tags.title" -r)
  filename="[$zerotrack] $title"

  mkvextract tracks "$zerotrack.mkv" 0:"$filename.opus"
  let COUNTER=COUNTER+1 
done
&lt;/code&gt;&lt;/pre&gt;
&lt;img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=29185&amp;amp;HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager"&gt;</content:encoded>
	

					<wfw:commentRss>https://shkspr.mobi/blog/2018/03/convert-surround-sound-wav-albums-to-individual-opus-files/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
