PageRenderTime 39ms CodeModel.GetById 15ms app.highlight 18ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://echo-nest-remix.googlecode.com/
HTML | 381 lines | 338 code | 19 blank | 24 comment | 0 complexity | 4a92a66d77c1316342cc5c95711b08b4 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.LocalAudioFile</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;LocalAudioFile
 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.LocalAudioFile-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 LocalAudioFile</h1><p class="nomargin-top"><span class="codelink"><a href="echonest.audio-pysrc.html#LocalAudioFile">source&nbsp;code</a></span></p>
 62<center>
 63
 64</center>
 65<hr />
 66The basic do-everything class for remixing. Acts as an <a href="echonest.audio.AudioData-class.html" class="link">AudioData</a>
 67object, but with an added <code class="link">analysis</code> selector which is an
 68<a href="echonest.audio.AudioAnalysis-class.html" class="link">AudioAnalysis</a> object. It conditianally uploads the file
 69it was initialized with. If the file is already known to the
 70Analyze API, then it does not bother uploading the file.
 71
 72<!-- ==================== INSTANCE METHODS ==================== -->
 73<a name="section-InstanceMethods"></a>
 74<table class="summary" border="1" cellpadding="3"
 75       cellspacing="0" width="100%" bgcolor="white">
 76<tr bgcolor="#70b0f0" class="table-header">
 77  <td colspan="2" class="table-header">
 78    <table border="0" cellpadding="0" cellspacing="0" width="100%">
 79      <tr valign="top">
 80        <td align="left"><span class="table-header">Instance Methods</span></td>
 81        <td align="right" valign="top"
 82         ><span class="options">[<a href="#section-InstanceMethods"
 83         class="privatelink" onclick="toggle_private();"
 84         >hide private</a>]</span></td>
 85      </tr>
 86    </table>
 87  </td>
 88</tr>
 89<tr>
 90    <td width="15%" align="right" valign="top" class="summary">
 91      <span class="summary-type">&nbsp;</span>
 92    </td><td class="summary">
 93      <table width="100%" cellpadding="0" cellspacing="0" border="0">
 94        <tr>
 95          <td><span class="summary-sig"><a href="echonest.audio.LocalAudioFile-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
 96        <span class="summary-sig-arg">filename</span>,
 97        <span class="summary-sig-arg">verbose</span>=<span class="summary-sig-default">True</span>,
 98        <span class="summary-sig-arg">defer</span>=<span class="summary-sig-default">False</span>)</span><br />
 99      Given an input <code class="link">ndarray</code>, import the sample values and shape
100(if none is specified) of the input <code class="link">numpy.array</code>.</td>
101          <td align="right" valign="top">
102            <span class="codelink"><a href="echonest.audio-pysrc.html#LocalAudioFile.__init__">source&nbsp;code</a></span>
103            
104          </td>
105        </tr>
106      </table>
107      
108    </td>
109  </tr>
110<tr>
111    <td width="15%" align="right" valign="top" class="summary">
112      <span class="summary-type">&nbsp;</span>
113    </td><td class="summary">
114      <table width="100%" cellpadding="0" cellspacing="0" border="0">
115        <tr>
116          <td><span class="summary-sig"><a name="toxml"></a><span class="summary-sig-name">toxml</span>(<span class="summary-sig-arg">self</span>,
117        <span class="summary-sig-arg">context</span>=<span class="summary-sig-default">None</span>)</span></td>
118          <td align="right" valign="top">
119            <span class="codelink"><a href="echonest.audio-pysrc.html#LocalAudioFile.toxml">source&nbsp;code</a></span>
120            
121          </td>
122        </tr>
123      </table>
124      
125    </td>
126  </tr>
127<tr>
128    <td width="15%" align="right" valign="top" class="summary">
129      <span class="summary-type">&nbsp;</span>
130    </td><td class="summary">
131      <table width="100%" cellpadding="0" cellspacing="0" border="0">
132        <tr>
133          <td><span class="summary-sig"><a name="__setstate__"></a><span class="summary-sig-name">__setstate__</span>(<span class="summary-sig-arg">self</span>,
134        <span class="summary-sig-arg">state</span>)</span><br />
135      Recreates circular reference after unpickling.</td>
136          <td align="right" valign="top">
137            <span class="codelink"><a href="echonest.audio-pysrc.html#LocalAudioFile.__setstate__">source&nbsp;code</a></span>
138            
139          </td>
140        </tr>
141      </table>
142      
143    </td>
144  </tr>
145  <tr>
146    <td colspan="2" class="summary">
147    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="echonest.audio.AudioData-class.html">AudioData</a></code></b>:
148      <code><a href="echonest.audio.AudioData-class.html#__add__">__add__</a></code>,
149      <code><a href="echonest.audio.AudioData-class.html#__getitem__">__getitem__</a></code>,
150      <code><a href="echonest.audio.AudioData-class.html#__len__">__len__</a></code>,
151      <code><a href="echonest.audio.AudioData-class.html#add_at">add_at</a></code>,
152      <code><a href="echonest.audio.AudioData-class.html#append">append</a></code>,
153      <code><a href="echonest.audio.AudioData-class.html#encode">encode</a></code>,
154      <code><a href="echonest.audio.AudioData-class.html#getsample">getsample</a></code>,
155      <code><a href="echonest.audio.AudioData-class.html#getslice">getslice</a></code>,
156      <code><a href="echonest.audio.AudioData-class.html#load">load</a></code>,
157      <code><a href="echonest.audio.AudioData-class.html#pad_with_zeros">pad_with_zeros</a></code>,
158      <code><a href="echonest.audio.AudioData-class.html#render">render</a></code>,
159      <code><a href="echonest.audio.AudioData-class.html#sum">sum</a></code>,
160      <code><a href="echonest.audio.AudioData-class.html#unload">unload</a></code>
161      </p>
162    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="echonest.audio.AudioRenderable-class.html">AudioRenderable</a></code></b>:
163      <code><a href="echonest.audio.AudioRenderable-class.html#resolve_source">resolve_source</a></code>,
164      <code><a href="echonest.audio.AudioRenderable-class.html#sources">sources</a></code>
165      </p>
166    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
167      <code>__delattr__</code>,
168      <code>__format__</code>,
169      <code>__getattribute__</code>,
170      <code>__hash__</code>,
171      <code>__new__</code>,
172      <code>__reduce__</code>,
173      <code>__reduce_ex__</code>,
174      <code>__repr__</code>,
175      <code>__setattr__</code>,
176      <code>__sizeof__</code>,
177      <code>__str__</code>,
178      <code>__subclasshook__</code>
179      </p>
180    </td>
181  </tr>
182</table>
183<!-- ==================== STATIC METHODS ==================== -->
184<a name="section-StaticMethods"></a>
185<table class="summary" border="1" cellpadding="3"
186       cellspacing="0" width="100%" bgcolor="white">
187<tr bgcolor="#70b0f0" class="table-header">
188  <td colspan="2" class="table-header">
189    <table border="0" cellpadding="0" cellspacing="0" width="100%">
190      <tr valign="top">
191        <td align="left"><span class="table-header">Static Methods</span></td>
192        <td align="right" valign="top"
193         ><span class="options">[<a href="#section-StaticMethods"
194         class="privatelink" onclick="toggle_private();"
195         >hide private</a>]</span></td>
196      </tr>
197    </table>
198  </td>
199</tr>
200  <tr>
201    <td colspan="2" class="summary">
202    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="echonest.audio.AudioRenderable-class.html">AudioRenderable</a></code></b>:
203      <code><a href="echonest.audio.AudioRenderable-class.html#init_audio_data">init_audio_data</a></code>
204      </p>
205    </td>
206  </tr>
207</table>
208<!-- ==================== PROPERTIES ==================== -->
209<a name="section-Properties"></a>
210<table class="summary" border="1" cellpadding="3"
211       cellspacing="0" width="100%" bgcolor="white">
212<tr bgcolor="#70b0f0" class="table-header">
213  <td colspan="2" class="table-header">
214    <table border="0" cellpadding="0" cellspacing="0" width="100%">
215      <tr valign="top">
216        <td align="left"><span class="table-header">Properties</span></td>
217        <td align="right" valign="top"
218         ><span class="options">[<a href="#section-Properties"
219         class="privatelink" onclick="toggle_private();"
220         >hide private</a>]</span></td>
221      </tr>
222    </table>
223  </td>
224</tr>
225<tr>
226    <td width="15%" align="right" valign="top" class="summary">
227      <span class="summary-type">&nbsp;</span>
228    </td><td class="summary">
229        <a href="echonest.audio.LocalAudioFile-class.html#duration" class="summary-name">duration</a><br />
230      Since we consider <code class="link">AudioFile</code> to be an evolved version of
231<a href="echonest.audio.AudioData-class.html" class="link">AudioData</a>, we return the measured duration from the analysis.
232    </td>
233  </tr>
234  <tr>
235    <td colspan="2" class="summary">
236    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="echonest.audio.AudioData-class.html">AudioData</a></code></b>:
237      <code><a href="echonest.audio.AudioData-class.html#source">source</a></code>
238      </p>
239    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
240      <code>__class__</code>
241      </p>
242    </td>
243  </tr>
244</table>
245<!-- ==================== METHOD DETAILS ==================== -->
246<a name="section-MethodDetails"></a>
247<table class="details" border="1" cellpadding="3"
248       cellspacing="0" width="100%" bgcolor="white">
249<tr bgcolor="#70b0f0" class="table-header">
250  <td colspan="2" class="table-header">
251    <table border="0" cellpadding="0" cellspacing="0" width="100%">
252      <tr valign="top">
253        <td align="left"><span class="table-header">Method Details</span></td>
254        <td align="right" valign="top"
255         ><span class="options">[<a href="#section-MethodDetails"
256         class="privatelink" onclick="toggle_private();"
257         >hide private</a>]</span></td>
258      </tr>
259    </table>
260  </td>
261</tr>
262</table>
263<a name="__init__"></a>
264<div>
265<table class="details" border="1" cellpadding="3"
266       cellspacing="0" width="100%" bgcolor="white">
267<tr><td>
268  <table width="100%" cellpadding="0" cellspacing="0" border="0">
269  <tr valign="top"><td>
270  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
271        <span class="sig-arg">filename</span>,
272        <span class="sig-arg">verbose</span>=<span class="sig-default">True</span>,
273        <span class="sig-arg">defer</span>=<span class="sig-default">False</span>)</span>
274    <br /><em class="fname">(Constructor)</em>
275  </h3>
276  </td><td align="right" valign="top"
277    ><span class="codelink"><a href="echonest.audio-pysrc.html#LocalAudioFile.__init__">source&nbsp;code</a></span>&nbsp;
278    </td>
279  </tr></table>
280  
281  <p>Given an input <code class="link">ndarray</code>, import the sample values and shape
282(if none is specified) of the input <code class="link">numpy.array</code>.</p>
283<p>Given a <code class="link">filename</code> (and an input ndarray), use ffmpeg to convert
284the file to wave, then load the file into the data,
285auto-detecting the sample rate, and number of channels.</p>
286  <dl class="fields">
287    <dt>Parameters:</dt>
288    <dd><ul class="nomargin-top">
289        <li><strong class="pname"><code>filename</code></strong> - path to a local MP3 file</li>
290    </ul></dd>
291    <dt>Overrides:
292        object.__init__
293    </dt>
294  </dl>
295</td></tr></table>
296</div>
297<br />
298<!-- ==================== PROPERTY DETAILS ==================== -->
299<a name="section-PropertyDetails"></a>
300<table class="details" border="1" cellpadding="3"
301       cellspacing="0" width="100%" bgcolor="white">
302<tr bgcolor="#70b0f0" class="table-header">
303  <td colspan="2" class="table-header">
304    <table border="0" cellpadding="0" cellspacing="0" width="100%">
305      <tr valign="top">
306        <td align="left"><span class="table-header">Property Details</span></td>
307        <td align="right" valign="top"
308         ><span class="options">[<a href="#section-PropertyDetails"
309         class="privatelink" onclick="toggle_private();"
310         >hide private</a>]</span></td>
311      </tr>
312    </table>
313  </td>
314</tr>
315</table>
316<a name="duration"></a>
317<div>
318<table class="details" border="1" cellpadding="3"
319       cellspacing="0" width="100%" bgcolor="white">
320<tr><td>
321  <h3 class="epydoc">duration</h3>
322  Since we consider <code class="link">AudioFile</code> to be an evolved version of
323<a href="echonest.audio.AudioData-class.html" class="link">AudioData</a>, we return the measured duration from the analysis.
324  <dl class="fields">
325    <dt>Get Method:</dt>
326    <dd class="value"><span class="summary-sig"><i>unreachable</i>.duration(<span class="summary-sig-arg">self</span>)</span>
327        - Since we consider <code class="link">AudioFile</code> to be an evolved version of
328<a href="echonest.audio.AudioData-class.html" class="link">AudioData</a>, we return the measured duration from the analysis.
329    </dd>
330  </dl>
331</td></tr></table>
332</div>
333<br />
334<!-- ==================== NAVIGATION BAR ==================== -->
335<table class="navbar" border="0" width="100%" cellpadding="0"
336       bgcolor="#a0c0ff" cellspacing="0">
337  <tr valign="middle">
338
339  <!-- Tree link -->
340      <th>&nbsp;&nbsp;&nbsp;<a
341        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
342
343  <!-- Index link -->
344      <th>&nbsp;&nbsp;&nbsp;<a
345        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
346
347  <!-- Help link -->
348      <th>&nbsp;&nbsp;&nbsp;<a
349        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
350
351  <!-- Project homepage -->
352      <th class="navbar" align="right" width="100%">
353        <table border="0" cellpadding="0" cellspacing="0">
354          <tr><th class="navbar" align="center"
355            ><a class="navbar" target="_top" href="http://code.google.com/p/echo-nest-remix/">Project Homepage</a></th>
356          </tr></table></th>
357  </tr>
358</table>
359<table border="0" cellpadding="0" cellspacing="0" width="100%%">
360  <tr>
361    <td align="left" class="footer">
362    Generated by Epydoc 3.0.1 on Wed Sep  1 16:08:58 2010
363    </td>
364    <td align="right" class="footer">
365      <a target="mainFrame" href="http://epydoc.sourceforge.net"
366        >http://epydoc.sourceforge.net</a>
367    </td>
368  </tr>
369</table>
370
371<script type="text/javascript">
372  <!--
373  // Private objects are initially displayed (because if
374  // javascript is turned off then we want them to be
375  // visible); but by default, we want to hide them.  So hide
376  // them unless we have a cookie that says to show them.
377  checkCookie();
378  // -->
379</script>
380</body>
381</html>