PageRenderTime 47ms CodeModel.GetById 21ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 0ms

/src/pyechonest/doc/build/html/track.html

Relevant Search: With Applications for Solr and Elasticsearch

For more in depth reading about search, ranking and generally everything you could ever want to know about how lucene, elasticsearch or solr work under the hood I highly suggest this book. Easily one of the most interesting technical books I have read in a long time. If you are tasked with solving search relevance problems even if not in Solr or Elasticsearch it should be your first reference. Amazon Affiliate Link
http://echo-nest-remix.googlecode.com/
HTML | 289 lines | 272 code | 17 blank | 0 comment | 0 complexity | d8efd05c3969ae4e53e166ae6bc3201a MD5 | raw file
  1
  2
  3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  4  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5
  6<html xmlns="http://www.w3.org/1999/xhtml">
  7  <head>
  8    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9    
 10    <title>Track – track methods &mdash; pyechonest v4 documentation</title>
 11    <link rel="stylesheet" href="_static/default.css" type="text/css" />
 12    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
 13    <script type="text/javascript">
 14      var DOCUMENTATION_OPTIONS = {
 15        URL_ROOT:    '',
 16        VERSION:     '4',
 17        COLLAPSE_INDEX: false,
 18        FILE_SUFFIX: '.html',
 19        HAS_SOURCE:  true
 20      };
 21    </script>
 22    <script type="text/javascript" src="_static/jquery.js"></script>
 23    <script type="text/javascript" src="_static/underscore.js"></script>
 24    <script type="text/javascript" src="_static/doctools.js"></script>
 25    <link rel="top" title="pyechonest v4 documentation" href="index.html" />
 26    <link rel="next" title="Playlist – playlist methods" href="playlist.html" />
 27    <link rel="prev" title="Song – song methods" href="song.html" /> 
 28  </head>
 29  <body>
 30    <div class="related">
 31      <h3>Navigation</h3>
 32      <ul>
 33        <li class="right" style="margin-right: 10px">
 34          <a href="genindex.html" title="General Index"
 35             accesskey="I">index</a></li>
 36        <li class="right" >
 37          <a href="py-modindex.html" title="Python Module Index"
 38             >modules</a> |</li>
 39        <li class="right" >
 40          <a href="playlist.html" title="Playlist – playlist methods"
 41             accesskey="N">next</a> |</li>
 42        <li class="right" >
 43          <a href="song.html" title="Song – song methods"
 44             accesskey="P">previous</a> |</li>
 45        <li><a href="index.html">pyechonest v4 documentation</a> &raquo;</li> 
 46      </ul>
 47    </div>  
 48
 49    <div class="document">
 50      <div class="documentwrapper">
 51        <div class="bodywrapper">
 52          <div class="body">
 53            
 54  <div class="section" id="track-track-methods">
 55<h1>Track &#8211; track methods<a class="headerlink" href="#track-track-methods" title="Permalink to this headline">ś</a></h1>
 56<dl class="class">
 57<dt id="pyechonest.track.Track">
 58<em class="property">class </em><tt class="descclassname">pyechonest.track.</tt><tt class="descname">Track</tt><big>(</big><em>identifier</em>, <em>md5</em>, <em>properties</em><big>)</big><a class="headerlink" href="#pyechonest.track.Track" title="Permalink to this definition">ś</a></dt>
 59<dd><p>Represents an audio analysis from The Echo Nest.</p>
 60<p>All methods in this module return Track objects.</p>
 61<p>Attributes:</p>
 62<blockquote>
 63<p>analysis_channels       int: the number of audio channels used during analysis</p>
 64<p>analysis_sample_rate    float: the sample rate used during analysis</p>
 65<p>analyzer_version        str: e.g. &#8216;3.01a&#8217;</p>
 66<p>artist                  str or None: artist name</p>
 67<p>bars                    list of dicts: timing of each measure</p>
 68<p>beats                   list of dicts: timing of each beat</p>
 69<p>bitrate                 int: the bitrate of the input mp3 (or other file)</p>
 70<p>danceability            float: relative danceability (0 to 1)</p>
 71<p>duration                float: length of track in seconds</p>
 72<p>energy                  float: relative energy (0 to 1)</p>
 73<p>end_of_fade_in          float: time in seconds track where fade-in ends</p>
 74<p>id                      str: Echo Nest Track ID, e.g. &#8216;TRTOBXJ1296BCDA33B&#8217;</p>
 75<p>key                     int: between 0 (key of C) and 11 (key of B flat) inclusive</p>
 76<p>key_confidence          float: confidence that key detection was accurate</p>
 77<p>loudness                float: overall loudness in decibels (dB)</p>
 78<p>md5                     str: 32-character checksum of the input mp3</p>
 79<p>meta                    dict: other track metainfo</p>
 80<p>mode                    int: 0 (major) or 1 (minor)</p>
 81<p>mode_confidence         float: confidence that mode detection was accurate</p>
 82<p>num_samples             int: total samples in the decoded track</p>
 83<p>release                 str or None: the album name</p>
 84<p>sample_md5              str: 32-character checksum of the decoded audio file</p>
 85<p>samplerate              int: sample rate of input mp3</p>
 86<p>sections                list of dicts: larger sections of song (chorus, bridge, solo, etc.)</p>
 87<p>segments                list of dicts: timing, pitch, loudness and timbre for each segment</p>
 88<p>start_of_fade_out       float: time in seconds where fade out begins</p>
 89<p>status                  str: analysis status, e.g. &#8216;complete&#8217;, &#8216;pending&#8217;, &#8216;error&#8217;</p>
 90<p>tatums                  list of dicts: the smallest metrical unit (subdivision of a beat)</p>
 91<p>tempo                   float: overall BPM (beats per minute)</p>
 92<p>tempo_confidence        float: confidence that tempo detection was accurate</p>
 93<p>title                   str or None: song title</p>
 94</blockquote>
 95<p>Each bar, beat, section, segment and tatum has a start time, a duration, and a confidence,
 96in addition to whatever other data is given.</p>
 97<p>Examples:</p>
 98<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">track</span><span class="o">.</span><span class="n">track_from_id</span><span class="p">(</span><span class="s">&#39;TRXXHTJ1294CD8F3B3&#39;</span><span class="p">)</span>
 99<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span>
100<span class="go">&lt;track - Neverwas Restored (from Neverwas Soundtrack)&gt;</span>
101<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">track</span><span class="o">.</span><span class="n">track_from_md5</span><span class="p">(</span><span class="s">&#39;b8abf85746ab3416adabca63141d8c2d&#39;</span><span class="p">)</span>
102<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span>
103<span class="go">&lt;track - Neverwas Restored (from Neverwas Soundtrack)&gt;</span>
104<span class="gp">&gt;&gt;&gt; </span>
105</pre></div>
106</div>
107<dl class="method">
108<dt id="pyechonest.track.Track.__repr__">
109<tt class="descname">__repr__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyechonest.track.Track.__repr__" title="Permalink to this definition">ś</a></dt>
110<dd></dd></dl>
111
112<dl class="method">
113<dt id="pyechonest.track.Track.__str__">
114<tt class="descname">__str__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyechonest.track.Track.__str__" title="Permalink to this definition">ś</a></dt>
115<dd></dd></dl>
116
117</dd></dl>
118
119<dl class="staticmethod">
120<dt id="pyechonest.track.track_from_file">
121<em class="property">static </em><tt class="descclassname">track.</tt><tt class="descname">track_from_file</tt><big>(</big><em>file_object</em>, <em>filetype</em><big>)</big><a class="headerlink" href="#pyechonest.track.track_from_file" title="Permalink to this definition">ś</a></dt>
122<dd><p>Create a track object from a file-like object.</p>
123<dl class="docutils">
124<dt>Args:</dt>
125<dd>file_object: a file-like Python object
126filetype: the file type (ex. mp3, ogg, wav)</dd>
127<dt>Example:</dt>
128<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="s">&quot;Miaow-01-Tempered-song.mp3&quot;</span><span class="p">)</span>
129<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">track</span><span class="o">.</span><span class="n">track_from_file</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="s">&#39;mp3&#39;</span><span class="p">)</span>
130<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span>
131<span class="go">&lt; Track &gt;</span>
132<span class="go">&gt;&gt;&gt;</span>
133</pre></div>
134</div>
135</dd>
136</dl>
137</dd></dl>
138
139<dl class="staticmethod">
140<dt id="pyechonest.track.track_from_filename">
141<em class="property">static </em><tt class="descclassname">track.</tt><tt class="descname">track_from_filename</tt><big>(</big><em>filename</em>, <em>filetype=None</em><big>)</big><a class="headerlink" href="#pyechonest.track.track_from_filename" title="Permalink to this definition">ś</a></dt>
142<dd><p>Create a track object from a filename.</p>
143<dl class="docutils">
144<dt>Args:</dt>
145<dd>filename: A string containing the path to the input file.
146filetype: A string indicating the filetype; Defaults to None (type determined by file extension).</dd>
147<dt>Example:</dt>
148<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">track</span><span class="o">.</span><span class="n">track_from_filename</span><span class="p">(</span><span class="s">&quot;Miaow-01-Tempered-song.mp3&quot;</span><span class="p">)</span>
149<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span>
150<span class="go">&lt; Track &gt;</span>
151<span class="go">&gt;&gt;&gt;</span>
152</pre></div>
153</div>
154</dd>
155</dl>
156</dd></dl>
157
158<dl class="staticmethod">
159<dt id="pyechonest.track.track_from_url">
160<em class="property">static </em><tt class="descclassname">track.</tt><tt class="descname">track_from_url</tt><big>(</big><em>url</em><big>)</big><a class="headerlink" href="#pyechonest.track.track_from_url" title="Permalink to this definition">ś</a></dt>
161<dd><p>Create a track object from a public http URL.</p>
162<dl class="docutils">
163<dt>Args:</dt>
164<dd>url: A string giving the URL to read from. This must be on a public machine accessible by HTTP.</dd>
165<dt>Example:</dt>
166<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">track</span><span class="o">.</span><span class="n">track_from_url</span><span class="p">(</span><span class="s">&quot;http://www.miaowmusic.com/mp3/Miaow-01-Tempered-song.mp3&quot;</span><span class="p">)</span>
167<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span>
168<span class="go">&lt; Track &gt;</span>
169<span class="go">&gt;&gt;&gt;</span>
170</pre></div>
171</div>
172</dd>
173</dl>
174</dd></dl>
175
176<dl class="staticmethod">
177<dt id="pyechonest.track.track_from_id">
178<em class="property">static </em><tt class="descclassname">track.</tt><tt class="descname">track_from_id</tt><big>(</big><em>identifier</em><big>)</big><a class="headerlink" href="#pyechonest.track.track_from_id" title="Permalink to this definition">ś</a></dt>
179<dd><p>Create a track object from an Echo Nest track ID.</p>
180<dl class="docutils">
181<dt>Args:</dt>
182<dd>identifier: A string containing the ID of a previously analyzed track.</dd>
183<dt>Example:</dt>
184<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">track</span><span class="o">.</span><span class="n">track_from_id</span><span class="p">(</span><span class="s">&quot;TRWFIDS128F92CC4CA&quot;</span><span class="p">)</span>
185<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span>
186<span class="go">&lt;track - Let The Spirit&gt;</span>
187<span class="go">&gt;&gt;&gt;</span>
188</pre></div>
189</div>
190</dd>
191</dl>
192</dd></dl>
193
194<dl class="staticmethod">
195<dt id="pyechonest.track.track_from_md5">
196<em class="property">static </em><tt class="descclassname">track.</tt><tt class="descname">track_from_md5</tt><big>(</big><em>md5</em><big>)</big><a class="headerlink" href="#pyechonest.track.track_from_md5" title="Permalink to this definition">ś</a></dt>
197<dd><p>Create a track object from an md5 hash.</p>
198<dl class="docutils">
199<dt>Args:</dt>
200<dd>md5: A string 32 characters long giving the md5 checksum of a track already analyzed.</dd>
201<dt>Example:</dt>
202<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">track</span><span class="o">.</span><span class="n">track_from_md5</span><span class="p">(</span><span class="s">&#39;b8abf85746ab3416adabca63141d8c2d&#39;</span><span class="p">)</span>
203<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span>
204<span class="go">&lt;track - Neverwas Restored (from Neverwas Soundtrack)&gt;</span>
205<span class="go">&gt;&gt;&gt;</span>
206</pre></div>
207</div>
208</dd>
209</dl>
210</dd></dl>
211
212<dl class="staticmethod">
213<dt id="pyechonest.track.track_from_reanalyzing_md5">
214<em class="property">static </em><tt class="descclassname">track.</tt><tt class="descname">track_from_reanalyzing_md5</tt><big>(</big><em>md5</em><big>)</big><a class="headerlink" href="#pyechonest.track.track_from_reanalyzing_md5" title="Permalink to this definition">ś</a></dt>
215<dd><p>Create a track object from an md5 hash, reanalyzing the track first.</p>
216<dl class="docutils">
217<dt>Args:</dt>
218<dd>md5 (str): A string containing the md5 of a previously analyzed track</dd>
219<dt>Example:</dt>
220<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">track</span><span class="o">.</span><span class="n">track_from_reanalyzing_md5</span><span class="p">(</span><span class="s">&#39;b8abf85746ab3416adabca63141d8c2d&#39;</span><span class="p">)</span>
221<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span>
222<span class="go">&lt;track - Neverwas Restored&gt;</span>
223<span class="go">&gt;&gt;&gt;</span>
224</pre></div>
225</div>
226</dd>
227</dl>
228</dd></dl>
229
230</div>
231
232
233          </div>
234        </div>
235      </div>
236      <div class="sphinxsidebar">
237        <div class="sphinxsidebarwrapper">
238  <h4>Previous topic</h4>
239  <p class="topless"><a href="song.html"
240                        title="previous chapter">Song &#8211; song methods</a></p>
241  <h4>Next topic</h4>
242  <p class="topless"><a href="playlist.html"
243                        title="next chapter">Playlist &#8211; playlist methods</a></p>
244  <h3>This Page</h3>
245  <ul class="this-page-menu">
246    <li><a href="_sources/track.txt"
247           rel="nofollow">Show Source</a></li>
248  </ul>
249<div id="searchbox" style="display: none">
250  <h3>Quick search</h3>
251    <form class="search" action="search.html" method="get">
252      <input type="text" name="q" size="18" />
253      <input type="submit" value="Go" />
254      <input type="hidden" name="check_keywords" value="yes" />
255      <input type="hidden" name="area" value="default" />
256    </form>
257    <p class="searchtip" style="font-size: 90%">
258    Enter search terms or a module, class or function name.
259    </p>
260</div>
261<script type="text/javascript">$('#searchbox').show(0);</script>
262        </div>
263      </div>
264      <div class="clearer"></div>
265    </div>
266    <div class="related">
267      <h3>Navigation</h3>
268      <ul>
269        <li class="right" style="margin-right: 10px">
270          <a href="genindex.html" title="General Index"
271             >index</a></li>
272        <li class="right" >
273          <a href="py-modindex.html" title="Python Module Index"
274             >modules</a> |</li>
275        <li class="right" >
276          <a href="playlist.html" title="Playlist – playlist methods"
277             >next</a> |</li>
278        <li class="right" >
279          <a href="song.html" title="Song – song methods"
280             >previous</a> |</li>
281        <li><a href="index.html">pyechonest v4 documentation</a> &raquo;</li> 
282      </ul>
283    </div>
284    <div class="footer">
285        &copy; Copyright 2010, The Echo Nest.
286      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.5.
287    </div>
288  </body>
289</html>