PageRenderTime 347ms CodeModel.GetById 181ms app.highlight 17ms RepoModel.GetById 144ms app.codeStats 0ms

/apidocs/echonest.audio.AudioRenderable-class.html

http://echo-nest-remix.googlecode.com/
HTML | 327 lines | 283 code | 21 blank | 23 comment | 0 complexity | 7809c221517a1c8424d90a874cbcca83 MD5 | raw file
  1<?xml version="1.0" encoding="ascii"?>
  2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3          "DTD/xhtml1-transitional.dtd">
  4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5<head>
  6  <title>echonest.audio.AudioRenderable</title>
  7  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  8  <script type="text/javascript" src="epydoc.js"></script>
  9</head>
 10
 11<body bgcolor="white" text="black" link="blue" vlink="#204080"
 12      alink="#204080">
 13<!-- ==================== NAVIGATION BAR ==================== -->
 14<table class="navbar" border="0" width="100%" cellpadding="0"
 15       bgcolor="#a0c0ff" cellspacing="0">
 16  <tr valign="middle">
 17
 18  <!-- Tree link -->
 19      <th>&nbsp;&nbsp;&nbsp;<a
 20        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
 21
 22  <!-- Index link -->
 23      <th>&nbsp;&nbsp;&nbsp;<a
 24        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
 25
 26  <!-- Help link -->
 27      <th>&nbsp;&nbsp;&nbsp;<a
 28        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
 29
 30  <!-- Project homepage -->
 31      <th class="navbar" align="right" width="100%">
 32        <table border="0" cellpadding="0" cellspacing="0">
 33          <tr><th class="navbar" align="center"
 34            ><a class="navbar" target="_top" href="http://code.google.com/p/echo-nest-remix/">Project Homepage</a></th>
 35          </tr></table></th>
 36  </tr>
 37</table>
 38<table width="100%" cellpadding="0" cellspacing="0">
 39  <tr valign="top">
 40    <td width="100%">
 41      <span class="breadcrumbs">
 42        <a href="echonest-module.html">Package&nbsp;echonest</a> ::
 43        <a href="echonest.audio-module.html">Module&nbsp;audio</a> ::
 44        Class&nbsp;AudioRenderable
 45      </span>
 46    </td>
 47    <td>
 48      <table cellpadding="0" cellspacing="0">
 49        <!-- hide/show private -->
 50        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
 51    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
 52        <tr><td align="right"><span class="options"
 53            >[<a href="frames.html" target="_top">frames</a
 54            >]&nbsp;|&nbsp;<a href="echonest.audio.AudioRenderable-class.html"
 55            target="_top">no&nbsp;frames</a>]</span></td></tr>
 56      </table>
 57    </td>
 58  </tr>
 59</table>
 60<!-- ==================== CLASS DESCRIPTION ==================== -->
 61<h1 class="epydoc">Class AudioRenderable</h1><p class="nomargin-top"><span class="codelink"><a href="echonest.audio-pysrc.html#AudioRenderable">source&nbsp;code</a></span></p>
 62<center>
 63
 64</center>
 65<hr />
 66<p>An object that gives an <a href="echonest.audio.AudioData-class.html" class="link">AudioData</a> in response to a call to its <code class="link">render</code>()
 67method.
 68Intended to be an abstract class that helps enforce the <a href="echonest.audio.AudioRenderable-class.html" class="link">AudioRenderable</a>
 69protocol. Picked up a couple of convenience methods common to many descendants.</p>
 70<p>Every <a href="echonest.audio.AudioRenderable-class.html" class="link">AudioRenderable</a> must provide three things:</p>
 71<dl class="rst-docutils">
 72<dt>render()</dt>
 73<dd>A method returning the <a href="echonest.audio.AudioData-class.html" class="link">AudioData</a> for the object. The rhythmic duration (point
 74at which any following audio is appended) is signified by the <code class="link">endindex</code> accessor,
 75measured in samples.</dd>
 76<dt>source</dt>
 77<dd>An accessor pointing to the <a href="echonest.audio.AudioData-class.html" class="link">AudioData</a> that contains the original sample data of
 78(a superset of) this audio object.</dd>
 79<dt>duration</dt>
 80<dd>An accessor returning the rhythmic duration (in seconds) of the audio object.</dd>
 81</dl>
 82
 83<!-- ==================== INSTANCE METHODS ==================== -->
 84<a name="section-InstanceMethods"></a>
 85<table class="summary" border="1" cellpadding="3"
 86       cellspacing="0" width="100%" bgcolor="white">
 87<tr bgcolor="#70b0f0" class="table-header">
 88  <td colspan="2" class="table-header">
 89    <table border="0" cellpadding="0" cellspacing="0" width="100%">
 90      <tr valign="top">
 91        <td align="left"><span class="table-header">Instance Methods</span></td>
 92        <td align="right" valign="top"
 93         ><span class="options">[<a href="#section-InstanceMethods"
 94         class="privatelink" onclick="toggle_private();"
 95         >hide private</a>]</span></td>
 96      </tr>
 97    </table>
 98  </td>
 99</tr>
100<tr>
101    <td width="15%" align="right" valign="top" class="summary">
102      <span class="summary-type">&nbsp;</span>
103    </td><td class="summary">
104      <table width="100%" cellpadding="0" cellspacing="0" border="0">
105        <tr>
106          <td><span class="summary-sig"><a href="echonest.audio.AudioRenderable-class.html#resolve_source" class="summary-sig-name">resolve_source</a>(<span class="summary-sig-arg">self</span>,
107        <span class="summary-sig-arg">alt</span>)</span><br />
108      Given an alternative, fallback <code class="link">alt</code> source, return either <code class="link">self</code>'s
109source or the alternative.</td>
110          <td align="right" valign="top">
111            <span class="codelink"><a href="echonest.audio-pysrc.html#AudioRenderable.resolve_source">source&nbsp;code</a></span>
112            
113          </td>
114        </tr>
115      </table>
116      
117    </td>
118  </tr>
119<tr>
120    <td width="15%" align="right" valign="top" class="summary">
121      <span class="summary-type">&nbsp;</span>
122    </td><td class="summary">
123      <table width="100%" cellpadding="0" cellspacing="0" border="0">
124        <tr>
125          <td><span class="summary-sig"><a name="sources"></a><span class="summary-sig-name">sources</span>(<span class="summary-sig-arg">self</span>)</span></td>
126          <td align="right" valign="top">
127            <span class="codelink"><a href="echonest.audio-pysrc.html#AudioRenderable.sources">source&nbsp;code</a></span>
128            
129          </td>
130        </tr>
131      </table>
132      
133    </td>
134  </tr>
135<tr>
136    <td width="15%" align="right" valign="top" class="summary">
137      <span class="summary-type">&nbsp;</span>
138    </td><td class="summary">
139      <table width="100%" cellpadding="0" cellspacing="0" border="0">
140        <tr>
141          <td><span class="summary-sig"><a name="encode"></a><span class="summary-sig-name">encode</span>(<span class="summary-sig-arg">self</span>,
142        <span class="summary-sig-arg">filename</span>)</span><br />
143      Shortcut function that takes care of the need to obtain an <a href="echonest.audio.AudioData-class.html" class="link">AudioData</a>
144object first, through <code class="link">render</code>.</td>
145          <td align="right" valign="top">
146            <span class="codelink"><a href="echonest.audio-pysrc.html#AudioRenderable.encode">source&nbsp;code</a></span>
147            
148          </td>
149        </tr>
150      </table>
151      
152    </td>
153  </tr>
154  <tr>
155    <td colspan="2" class="summary">
156    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
157      <code>__delattr__</code>,
158      <code>__format__</code>,
159      <code>__getattribute__</code>,
160      <code>__hash__</code>,
161      <code>__init__</code>,
162      <code>__new__</code>,
163      <code>__reduce__</code>,
164      <code>__reduce_ex__</code>,
165      <code>__repr__</code>,
166      <code>__setattr__</code>,
167      <code>__sizeof__</code>,
168      <code>__str__</code>,
169      <code>__subclasshook__</code>
170      </p>
171    </td>
172  </tr>
173</table>
174<!-- ==================== STATIC METHODS ==================== -->
175<a name="section-StaticMethods"></a>
176<table class="summary" border="1" cellpadding="3"
177       cellspacing="0" width="100%" bgcolor="white">
178<tr bgcolor="#70b0f0" class="table-header">
179  <td colspan="2" class="table-header">
180    <table border="0" cellpadding="0" cellspacing="0" width="100%">
181      <tr valign="top">
182        <td align="left"><span class="table-header">Static Methods</span></td>
183        <td align="right" valign="top"
184         ><span class="options">[<a href="#section-StaticMethods"
185         class="privatelink" onclick="toggle_private();"
186         >hide private</a>]</span></td>
187      </tr>
188    </table>
189  </td>
190</tr>
191<tr>
192    <td width="15%" align="right" valign="top" class="summary">
193      <span class="summary-type">&nbsp;</span>
194    </td><td class="summary">
195      <table width="100%" cellpadding="0" cellspacing="0" border="0">
196        <tr>
197          <td><span class="summary-sig"><a name="init_audio_data"></a><span class="summary-sig-name">init_audio_data</span>(<span class="summary-sig-arg">source</span>,
198        <span class="summary-sig-arg">num_samples</span>)</span><br />
199      Convenience function for rendering: return a pre-allocated, zeroed
200<a href="echonest.audio.AudioData-class.html" class="link">AudioData</a>.</td>
201          <td align="right" valign="top">
202            <span class="codelink"><a href="echonest.audio-pysrc.html#AudioRenderable.init_audio_data">source&nbsp;code</a></span>
203            
204          </td>
205        </tr>
206      </table>
207      
208    </td>
209  </tr>
210</table>
211<!-- ==================== PROPERTIES ==================== -->
212<a name="section-Properties"></a>
213<table class="summary" border="1" cellpadding="3"
214       cellspacing="0" width="100%" bgcolor="white">
215<tr bgcolor="#70b0f0" class="table-header">
216  <td colspan="2" class="table-header">
217    <table border="0" cellpadding="0" cellspacing="0" width="100%">
218      <tr valign="top">
219        <td align="left"><span class="table-header">Properties</span></td>
220        <td align="right" valign="top"
221         ><span class="options">[<a href="#section-Properties"
222         class="privatelink" onclick="toggle_private();"
223         >hide private</a>]</span></td>
224      </tr>
225    </table>
226  </td>
227</tr>
228  <tr>
229    <td colspan="2" class="summary">
230    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
231      <code>__class__</code>
232      </p>
233    </td>
234  </tr>
235</table>
236<!-- ==================== METHOD DETAILS ==================== -->
237<a name="section-MethodDetails"></a>
238<table class="details" border="1" cellpadding="3"
239       cellspacing="0" width="100%" bgcolor="white">
240<tr bgcolor="#70b0f0" class="table-header">
241  <td colspan="2" class="table-header">
242    <table border="0" cellpadding="0" cellspacing="0" width="100%">
243      <tr valign="top">
244        <td align="left"><span class="table-header">Method Details</span></td>
245        <td align="right" valign="top"
246         ><span class="options">[<a href="#section-MethodDetails"
247         class="privatelink" onclick="toggle_private();"
248         >hide private</a>]</span></td>
249      </tr>
250    </table>
251  </td>
252</tr>
253</table>
254<a name="resolve_source"></a>
255<div>
256<table class="details" border="1" cellpadding="3"
257       cellspacing="0" width="100%" bgcolor="white">
258<tr><td>
259  <table width="100%" cellpadding="0" cellspacing="0" border="0">
260  <tr valign="top"><td>
261  <h3 class="epydoc"><span class="sig"><span class="sig-name">resolve_source</span>(<span class="sig-arg">self</span>,
262        <span class="sig-arg">alt</span>)</span>
263  </h3>
264  </td><td align="right" valign="top"
265    ><span class="codelink"><a href="echonest.audio-pysrc.html#AudioRenderable.resolve_source">source&nbsp;code</a></span>&nbsp;
266    </td>
267  </tr></table>
268  
269  <p>Given an alternative, fallback <code class="link">alt</code> source, return either <code class="link">self</code>'s
270source or the alternative. Throw an informative error if no source
271is found.</p>
272<p>Utility code that ended up being replicated in several places, so
273it ended up here. Not necessary for use in the RenderableAudioObject
274protocol.</p>
275  <dl class="fields">
276  </dl>
277</td></tr></table>
278</div>
279<br />
280<!-- ==================== NAVIGATION BAR ==================== -->
281<table class="navbar" border="0" width="100%" cellpadding="0"
282       bgcolor="#a0c0ff" cellspacing="0">
283  <tr valign="middle">
284
285  <!-- Tree link -->
286      <th>&nbsp;&nbsp;&nbsp;<a
287        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
288
289  <!-- Index link -->
290      <th>&nbsp;&nbsp;&nbsp;<a
291        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
292
293  <!-- Help link -->
294      <th>&nbsp;&nbsp;&nbsp;<a
295        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
296
297  <!-- Project homepage -->
298      <th class="navbar" align="right" width="100%">
299        <table border="0" cellpadding="0" cellspacing="0">
300          <tr><th class="navbar" align="center"
301            ><a class="navbar" target="_top" href="http://code.google.com/p/echo-nest-remix/">Project Homepage</a></th>
302          </tr></table></th>
303  </tr>
304</table>
305<table border="0" cellpadding="0" cellspacing="0" width="100%%">
306  <tr>
307    <td align="left" class="footer">
308    Generated by Epydoc 3.0.1 on Wed Sep  1 16:08:58 2010
309    </td>
310    <td align="right" class="footer">
311      <a target="mainFrame" href="http://epydoc.sourceforge.net"
312        >http://epydoc.sourceforge.net</a>
313    </td>
314  </tr>
315</table>
316
317<script type="text/javascript">
318  <!--
319  // Private objects are initially displayed (because if
320  // javascript is turned off then we want them to be
321  // visible); but by default, we want to hide them.  So hide
322  // them unless we have a cookie that says to show them.
323  checkCookie();
324  // -->
325</script>
326</body>
327</html>