PageRenderTime 32ms CodeModel.GetById 16ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://echo-nest-remix.googlecode.com/
HTML | 423 lines | 376 code | 24 blank | 23 comment | 0 complexity | 86d90f8bd38b6832b1dee833c69df7c0 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.AudioAnalysis</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;AudioAnalysis
 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.AudioAnalysis-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 AudioAnalysis</h1><p class="nomargin-top"><span class="codelink"><a href="echonest.audio-pysrc.html#AudioAnalysis">source&nbsp;code</a></span></p>
 62<center>
 63
 64</center>
 65<hr />
 66<p>This class wraps <code class="link">echonest.web</code> to allow transparent caching of the
 67audio analysis of an audio file.</p>
 68<p>For example, the following script will display the bars of a track
 69twice:</p>
 70<pre class="rst-literal-block">
 71from echonest import *
 72a = audio.AudioAnalysis('YOUR_TRACK_ID_HERE')
 73a.bars
 74a.bars
 75</pre>
 76<p>The first time <code class="link">a.bars</code> is called, a network request is made of the
 77<a class="rst-reference external" href="http://the.echonest.com/" target="_top">Echo Nest</a> <a class="rst-reference external" href="http://developer.echonest.com/pages/overview?version=2" target="_top">Analyze API</a>.  The second time time <code class="link">a.bars</code> is called, the
 78cached value is returned immediately.</p>
 79<p>An <a href="echonest.audio.AudioAnalysis-class.html" class="link">AudioAnalysis</a> object can be created using an existing ID, as in
 80the example above, or by specifying the audio file to upload in
 81order to create the ID, as in:</p>
 82<pre class="rst-literal-block">
 83a = audio.AudioAnalysis('FULL_PATH_TO_AUDIO_FILE')
 84</pre>
 85
 86<!-- ==================== INSTANCE METHODS ==================== -->
 87<a name="section-InstanceMethods"></a>
 88<table class="summary" border="1" cellpadding="3"
 89       cellspacing="0" width="100%" bgcolor="white">
 90<tr bgcolor="#70b0f0" class="table-header">
 91  <td colspan="2" class="table-header">
 92    <table border="0" cellpadding="0" cellspacing="0" width="100%">
 93      <tr valign="top">
 94        <td align="left"><span class="table-header">Instance Methods</span></td>
 95        <td align="right" valign="top"
 96         ><span class="options">[<a href="#section-InstanceMethods"
 97         class="privatelink" onclick="toggle_private();"
 98         >hide private</a>]</span></td>
 99      </tr>
100    </table>
101  </td>
102</tr>
103<tr>
104    <td width="15%" align="right" valign="top" class="summary">
105      <span class="summary-type">&nbsp;</span>
106    </td><td class="summary">
107      <table width="100%" cellpadding="0" cellspacing="0" border="0">
108        <tr>
109          <td><span class="summary-sig"><a href="echonest.audio.AudioAnalysis-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
110        <span class="summary-sig-arg">path_or_identifier</span>)</span><br />
111      Constructor.</td>
112          <td align="right" valign="top">
113            <span class="codelink"><a href="echonest.audio-pysrc.html#AudioAnalysis.__init__">source&nbsp;code</a></span>
114            
115          </td>
116        </tr>
117      </table>
118      
119    </td>
120  </tr>
121<tr>
122    <td width="15%" align="right" valign="top" class="summary">
123      <span class="summary-type">&nbsp;</span>
124    </td><td class="summary">
125      <table width="100%" cellpadding="0" cellspacing="0" border="0">
126        <tr>
127          <td><span class="summary-sig"><a name="__getstate__"></a><span class="summary-sig-name">__getstate__</span>(<span class="summary-sig-arg">self</span>)</span><br />
128      Eliminates the circular reference for pickling.</td>
129          <td align="right" valign="top">
130            <span class="codelink"><a href="echonest.audio-pysrc.html#AudioAnalysis.__getstate__">source&nbsp;code</a></span>
131            
132          </td>
133        </tr>
134      </table>
135      
136    </td>
137  </tr>
138<tr>
139    <td width="15%" align="right" valign="top" class="summary">
140      <span class="summary-type">&nbsp;</span>
141    </td><td class="summary">
142      <table width="100%" cellpadding="0" cellspacing="0" border="0">
143        <tr>
144          <td><span class="summary-sig"><a name="__setstate__"></a><span class="summary-sig-name">__setstate__</span>(<span class="summary-sig-arg">self</span>,
145        <span class="summary-sig-arg">state</span>)</span><br />
146      Recreates circular references after unpickling.</td>
147          <td align="right" valign="top">
148            <span class="codelink"><a href="echonest.audio-pysrc.html#AudioAnalysis.__setstate__">source&nbsp;code</a></span>
149            
150          </td>
151        </tr>
152      </table>
153      
154    </td>
155  </tr>
156  <tr>
157    <td colspan="2" class="summary">
158    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
159      <code>__delattr__</code>,
160      <code>__format__</code>,
161      <code>__getattribute__</code>,
162      <code>__hash__</code>,
163      <code>__new__</code>,
164      <code>__reduce__</code>,
165      <code>__reduce_ex__</code>,
166      <code>__repr__</code>,
167      <code>__setattr__</code>,
168      <code>__sizeof__</code>,
169      <code>__str__</code>,
170      <code>__subclasshook__</code>
171      </p>
172    </td>
173  </tr>
174</table>
175<!-- ==================== PROPERTIES ==================== -->
176<a name="section-Properties"></a>
177<table class="summary" border="1" cellpadding="3"
178       cellspacing="0" width="100%" bgcolor="white">
179<tr bgcolor="#70b0f0" class="table-header">
180  <td colspan="2" class="table-header">
181    <table border="0" cellpadding="0" cellspacing="0" width="100%">
182      <tr valign="top">
183        <td align="left"><span class="table-header">Properties</span></td>
184        <td align="right" valign="top"
185         ><span class="options">[<a href="#section-Properties"
186         class="privatelink" onclick="toggle_private();"
187         >hide private</a>]</span></td>
188      </tr>
189    </table>
190  </td>
191</tr>
192<tr>
193    <td width="15%" align="right" valign="top" class="summary">
194      <span class="summary-type">&nbsp;</span>
195    </td><td class="summary">
196        <a href="echonest.audio.AudioAnalysis-class.html#bars" class="summary-name">bars</a>
197    </td>
198  </tr>
199<tr>
200    <td width="15%" align="right" valign="top" class="summary">
201      <span class="summary-type">&nbsp;</span>
202    </td><td class="summary">
203        <a href="echonest.audio.AudioAnalysis-class.html#beats" class="summary-name">beats</a>
204    </td>
205  </tr>
206<tr>
207    <td width="15%" align="right" valign="top" class="summary">
208      <span class="summary-type">&nbsp;</span>
209    </td><td class="summary">
210        <a href="echonest.audio.AudioAnalysis-class.html#tatums" class="summary-name">tatums</a>
211    </td>
212  </tr>
213<tr>
214    <td width="15%" align="right" valign="top" class="summary">
215      <span class="summary-type">&nbsp;</span>
216    </td><td class="summary">
217        <a href="echonest.audio.AudioAnalysis-class.html#sections" class="summary-name">sections</a>
218    </td>
219  </tr>
220<tr>
221    <td width="15%" align="right" valign="top" class="summary">
222      <span class="summary-type">&nbsp;</span>
223    </td><td class="summary">
224        <a href="echonest.audio.AudioAnalysis-class.html#segments" class="summary-name">segments</a>
225    </td>
226  </tr>
227  <tr>
228    <td colspan="2" class="summary">
229    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
230      <code>__class__</code>
231      </p>
232    </td>
233  </tr>
234</table>
235<!-- ==================== METHOD DETAILS ==================== -->
236<a name="section-MethodDetails"></a>
237<table class="details" border="1" cellpadding="3"
238       cellspacing="0" width="100%" bgcolor="white">
239<tr bgcolor="#70b0f0" class="table-header">
240  <td colspan="2" class="table-header">
241    <table border="0" cellpadding="0" cellspacing="0" width="100%">
242      <tr valign="top">
243        <td align="left"><span class="table-header">Method Details</span></td>
244        <td align="right" valign="top"
245         ><span class="options">[<a href="#section-MethodDetails"
246         class="privatelink" onclick="toggle_private();"
247         >hide private</a>]</span></td>
248      </tr>
249    </table>
250  </td>
251</tr>
252</table>
253<a name="__init__"></a>
254<div>
255<table class="details" border="1" cellpadding="3"
256       cellspacing="0" width="100%" bgcolor="white">
257<tr><td>
258  <table width="100%" cellpadding="0" cellspacing="0" border="0">
259  <tr valign="top"><td>
260  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
261        <span class="sig-arg">path_or_identifier</span>)</span>
262    <br /><em class="fname">(Constructor)</em>
263  </h3>
264  </td><td align="right" valign="top"
265    ><span class="codelink"><a href="echonest.audio-pysrc.html#AudioAnalysis.__init__">source&nbsp;code</a></span>&nbsp;
266    </td>
267  </tr></table>
268  
269  <p>Constructor.  If the argument is a valid local path or a URL,
270the track ID is generated by uploading the file to the <a class="rst-reference external" href="http://the.echonest.com/" target="_top">Echo Nest</a>
271<a class="rst-reference external" href="http://developer.echonest.com/track.html#upload" target="_top">Analyze API</a>.  Otherwise, the argument is assumed to be
272the track ID.</p>
273  <dl class="fields">
274    <dt>Parameters:</dt>
275    <dd><ul class="nomargin-top">
276        <li><strong class="pname"><code>path_or_identifier</code></strong> - A string representing either a path to a local
277file, or the ID of a file that has already
278been uploaded for analysis.</li>
279    </ul></dd>
280    <dt>Overrides:
281        object.__init__
282    </dt>
283  </dl>
284</td></tr></table>
285</div>
286<br />
287<!-- ==================== PROPERTY DETAILS ==================== -->
288<a name="section-PropertyDetails"></a>
289<table class="details" border="1" cellpadding="3"
290       cellspacing="0" width="100%" bgcolor="white">
291<tr bgcolor="#70b0f0" class="table-header">
292  <td colspan="2" class="table-header">
293    <table border="0" cellpadding="0" cellspacing="0" width="100%">
294      <tr valign="top">
295        <td align="left"><span class="table-header">Property Details</span></td>
296        <td align="right" valign="top"
297         ><span class="options">[<a href="#section-PropertyDetails"
298         class="privatelink" onclick="toggle_private();"
299         >hide private</a>]</span></td>
300      </tr>
301    </table>
302  </td>
303</tr>
304</table>
305<a name="bars"></a>
306<div>
307<table class="details" border="1" cellpadding="3"
308       cellspacing="0" width="100%" bgcolor="white">
309<tr><td>
310  <h3 class="epydoc">bars</h3>
311  
312  <dl class="fields">
313    <dt>Get Method:</dt>
314    <dd class="value"><span class="summary-sig"><i>unreachable</i>.bars(<span class="summary-sig-arg">self</span>)</span>
315    </dd>
316  </dl>
317</td></tr></table>
318</div>
319<a name="beats"></a>
320<div>
321<table class="details" border="1" cellpadding="3"
322       cellspacing="0" width="100%" bgcolor="white">
323<tr><td>
324  <h3 class="epydoc">beats</h3>
325  
326  <dl class="fields">
327    <dt>Get Method:</dt>
328    <dd class="value"><span class="summary-sig"><i>unreachable</i>.beats(<span class="summary-sig-arg">self</span>)</span>
329    </dd>
330  </dl>
331</td></tr></table>
332</div>
333<a name="tatums"></a>
334<div>
335<table class="details" border="1" cellpadding="3"
336       cellspacing="0" width="100%" bgcolor="white">
337<tr><td>
338  <h3 class="epydoc">tatums</h3>
339  
340  <dl class="fields">
341    <dt>Get Method:</dt>
342    <dd class="value"><span class="summary-sig"><i>unreachable</i>.tatums(<span class="summary-sig-arg">self</span>)</span>
343    </dd>
344  </dl>
345</td></tr></table>
346</div>
347<a name="sections"></a>
348<div>
349<table class="details" border="1" cellpadding="3"
350       cellspacing="0" width="100%" bgcolor="white">
351<tr><td>
352  <h3 class="epydoc">sections</h3>
353  
354  <dl class="fields">
355    <dt>Get Method:</dt>
356    <dd class="value"><span class="summary-sig"><i>unreachable</i>.sections(<span class="summary-sig-arg">self</span>)</span>
357    </dd>
358  </dl>
359</td></tr></table>
360</div>
361<a name="segments"></a>
362<div>
363<table class="details" border="1" cellpadding="3"
364       cellspacing="0" width="100%" bgcolor="white">
365<tr><td>
366  <h3 class="epydoc">segments</h3>
367  
368  <dl class="fields">
369    <dt>Get Method:</dt>
370    <dd class="value"><span class="summary-sig"><i>unreachable</i>.segments(<span class="summary-sig-arg">self</span>)</span>
371    </dd>
372  </dl>
373</td></tr></table>
374</div>
375<br />
376<!-- ==================== NAVIGATION BAR ==================== -->
377<table class="navbar" border="0" width="100%" cellpadding="0"
378       bgcolor="#a0c0ff" cellspacing="0">
379  <tr valign="middle">
380
381  <!-- Tree link -->
382      <th>&nbsp;&nbsp;&nbsp;<a
383        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
384
385  <!-- Index link -->
386      <th>&nbsp;&nbsp;&nbsp;<a
387        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
388
389  <!-- Help link -->
390      <th>&nbsp;&nbsp;&nbsp;<a
391        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
392
393  <!-- Project homepage -->
394      <th class="navbar" align="right" width="100%">
395        <table border="0" cellpadding="0" cellspacing="0">
396          <tr><th class="navbar" align="center"
397            ><a class="navbar" target="_top" href="http://code.google.com/p/echo-nest-remix/">Project Homepage</a></th>
398          </tr></table></th>
399  </tr>
400</table>
401<table border="0" cellpadding="0" cellspacing="0" width="100%%">
402  <tr>
403    <td align="left" class="footer">
404    Generated by Epydoc 3.0.1 on Wed Sep  1 16:08:58 2010
405    </td>
406    <td align="right" class="footer">
407      <a target="mainFrame" href="http://epydoc.sourceforge.net"
408        >http://epydoc.sourceforge.net</a>
409    </td>
410  </tr>
411</table>
412
413<script type="text/javascript">
414  <!--
415  // Private objects are initially displayed (because if
416  // javascript is turned off then we want them to be
417  // visible); but by default, we want to hide them.  So hide
418  // them unless we have a cookie that says to show them.
419  checkCookie();
420  // -->
421</script>
422</body>
423</html>