<?xml version="1.0" encoding="UTF-8"?>
<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/"
	>

<channel>
	<title>Aleks&#039; Domain &#187; editing</title>
	<atom:link href="http://metaleks.net/tag/editing/feed" rel="self" type="application/rss+xml" />
	<link>http://metaleks.net</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 19 Apr 2010 20:33:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Fansub Editing Tip</title>
		<link>http://metaleks.net/animes/a-fansub-editing-tip</link>
		<comments>http://metaleks.net/animes/a-fansub-editing-tip#comments</comments>
		<pubDate>Fri, 08 Jan 2010 03:57:23 +0000</pubDate>
		<dc:creator>Aleksandar Micovic</dc:creator>
				<category><![CDATA[Anime]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[editing]]></category>
		<category><![CDATA[one-liner]]></category>

		<guid isPermaLink="false">http://metaleks.net/?p=729</guid>
		<description><![CDATA[It seems that most of my posts have been crazy one-liners that do more than they should. This post is no different.
Motivation
Remember how your high school English teachers always stressed that you should be reading and re-reading your own work before submitting it? Out loud? It&#8217;s almost a fool-proof way to catch mistakes, but reading [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that most of my posts have been crazy one-liners that do more than they should. This post is no different.</p>
<h3>Motivation</h3>
<p>Remember how your high school English teachers always stressed that you should be reading and re-reading your own work before submitting it? <em>Out loud?</em> It&#8217;s almost a fool-proof way to catch mistakes, but reading can get tedious depending on what you have to read. In my case, I&#8217;ve recently started editing fansubs (Japanese animation, specifically) and found that reading the scripts can be quite difficult at times. So, I&#8217;ve put a small one-liner together to read the script for me!</p>
<h3>The Code</h3>
<p>Here is the line that solves my problems, followed by an explanation of it, for those of you who care.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> TARGET.ass <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;Dialogue&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/.*}\|.*0,,\|\\N//g'</span> <span style="color: #000000; font-weight: bold;">|</span> festival <span style="color: #660033;">--pipe</span> <span style="color: #660033;">--tts</span></pre></div></div>

<p>This only works on .ass files, and if you want to run it replace the <strong>TARGET.ass</strong> with the path to your script file. So, how does this work? Like this.</p>
<p>We first grab all of the file&#8217;s contents with <strong>cat TARGET.ass</strong>. Then, the entire script is filtered line by line allowing only the lines that start with &#8220;Dialogue&#8221; to pass through to the next stage. This is done with the <strong>grep &#8220;Dialogue&#8221;</strong> part. Next, and probably the most funky part of this entire one-liner is when the program <strong>sed</strong> is invoked. Basically, what <strong>sed -e &#8217;s/.*}\|.*0,,\|\\N//g&#8217; </strong> does is it removes everything that&#8217;s not actual dialogue. Why is this needed? Unfortunately, even though we have all of the lines that contain actual dialogue, every single one of these lines is littered with .ass format and control tags. All of this is filtered out, and we&#8217;re left with clean dialogue. The funky looking code is called a <a href="http://en.wikipedia.org/wiki/Regular_expression">regular expression</a>, if you&#8217;re interested. </p>
<p>At this point, we&#8217;re pretty much done. The last thing that needs to be done is to somehow give our script to a text-to-speech program. This is done with the <strong>festival &#8211;pipe &#8211;tts</strong> part. The program <strong>festival</strong> is a text-to-speech program, and if you&#8217;re wondering about the extra arguments passed to it, feel free to hit up the manual.</p>
<p>The default voice is pretty crap, but a simple search on Google reveals a plethora of guides on how to install different (and better!) voices.</p>
<p>I hope that this helps some of you!</p>
]]></content:encoded>
			<wfw:commentRss>http://metaleks.net/animes/a-fansub-editing-tip/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
