/src/pyechonest/doc/build/html/track.html
http://echo-nest-remix.googlecode.com/ · HTML · 289 lines · 272 code · 17 blank · 0 comment · 0 complexity · d8efd05c3969ae4e53e166ae6bc3201a MD5 · raw file
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Track track methods — pyechonest v4 documentation</title>
- <link rel="stylesheet" href="_static/default.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '',
- VERSION: '4',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <link rel="top" title="pyechonest v4 documentation" href="index.html" />
- <link rel="next" title="Playlist playlist methods" href="playlist.html" />
- <link rel="prev" title="Song song methods" href="song.html" />
- </head>
- <body>
- <div class="related">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="playlist.html" title="Playlist playlist methods"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="song.html" title="Song song methods"
- accesskey="P">previous</a> |</li>
- <li><a href="index.html">pyechonest v4 documentation</a> »</li>
- </ul>
- </div>
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body">
-
- <div class="section" id="track-track-methods">
- <h1>Track – track methods<a class="headerlink" href="#track-track-methods" title="Permalink to this headline">ś</a></h1>
- <dl class="class">
- <dt id="pyechonest.track.Track">
- <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>
- <dd><p>Represents an audio analysis from The Echo Nest.</p>
- <p>All methods in this module return Track objects.</p>
- <p>Attributes:</p>
- <blockquote>
- <p>analysis_channels int: the number of audio channels used during analysis</p>
- <p>analysis_sample_rate float: the sample rate used during analysis</p>
- <p>analyzer_version str: e.g. ‘3.01a’</p>
- <p>artist str or None: artist name</p>
- <p>bars list of dicts: timing of each measure</p>
- <p>beats list of dicts: timing of each beat</p>
- <p>bitrate int: the bitrate of the input mp3 (or other file)</p>
- <p>danceability float: relative danceability (0 to 1)</p>
- <p>duration float: length of track in seconds</p>
- <p>energy float: relative energy (0 to 1)</p>
- <p>end_of_fade_in float: time in seconds track where fade-in ends</p>
- <p>id str: Echo Nest Track ID, e.g. ‘TRTOBXJ1296BCDA33B’</p>
- <p>key int: between 0 (key of C) and 11 (key of B flat) inclusive</p>
- <p>key_confidence float: confidence that key detection was accurate</p>
- <p>loudness float: overall loudness in decibels (dB)</p>
- <p>md5 str: 32-character checksum of the input mp3</p>
- <p>meta dict: other track metainfo</p>
- <p>mode int: 0 (major) or 1 (minor)</p>
- <p>mode_confidence float: confidence that mode detection was accurate</p>
- <p>num_samples int: total samples in the decoded track</p>
- <p>release str or None: the album name</p>
- <p>sample_md5 str: 32-character checksum of the decoded audio file</p>
- <p>samplerate int: sample rate of input mp3</p>
- <p>sections list of dicts: larger sections of song (chorus, bridge, solo, etc.)</p>
- <p>segments list of dicts: timing, pitch, loudness and timbre for each segment</p>
- <p>start_of_fade_out float: time in seconds where fade out begins</p>
- <p>status str: analysis status, e.g. ‘complete’, ‘pending’, ‘error’</p>
- <p>tatums list of dicts: the smallest metrical unit (subdivision of a beat)</p>
- <p>tempo float: overall BPM (beats per minute)</p>
- <p>tempo_confidence float: confidence that tempo detection was accurate</p>
- <p>title str or None: song title</p>
- </blockquote>
- <p>Each bar, beat, section, segment and tatum has a start time, a duration, and a confidence,
- in addition to whatever other data is given.</p>
- <p>Examples:</p>
- <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </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">'TRXXHTJ1294CD8F3B3'</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">t</span>
- <span class="go"><track - Neverwas Restored (from Neverwas Soundtrack)></span>
- <span class="gp">>>> </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">'b8abf85746ab3416adabca63141d8c2d'</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">t</span>
- <span class="go"><track - Neverwas Restored (from Neverwas Soundtrack)></span>
- <span class="gp">>>> </span>
- </pre></div>
- </div>
- <dl class="method">
- <dt id="pyechonest.track.Track.__repr__">
- <tt class="descname">__repr__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyechonest.track.Track.__repr__" title="Permalink to this definition">ś</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pyechonest.track.Track.__str__">
- <tt class="descname">__str__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyechonest.track.Track.__str__" title="Permalink to this definition">ś</a></dt>
- <dd></dd></dl>
- </dd></dl>
- <dl class="staticmethod">
- <dt id="pyechonest.track.track_from_file">
- <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>
- <dd><p>Create a track object from a file-like object.</p>
- <dl class="docutils">
- <dt>Args:</dt>
- <dd>file_object: a file-like Python object
- filetype: the file type (ex. mp3, ogg, wav)</dd>
- <dt>Example:</dt>
- <dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">f</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="s">"Miaow-01-Tempered-song.mp3"</span><span class="p">)</span>
- <span class="gp">>>> </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">'mp3'</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">t</span>
- <span class="go">< Track ></span>
- <span class="go">>>></span>
- </pre></div>
- </div>
- </dd>
- </dl>
- </dd></dl>
- <dl class="staticmethod">
- <dt id="pyechonest.track.track_from_filename">
- <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>
- <dd><p>Create a track object from a filename.</p>
- <dl class="docutils">
- <dt>Args:</dt>
- <dd>filename: A string containing the path to the input file.
- filetype: A string indicating the filetype; Defaults to None (type determined by file extension).</dd>
- <dt>Example:</dt>
- <dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">>>> </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">"Miaow-01-Tempered-song.mp3"</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">t</span>
- <span class="go">< Track ></span>
- <span class="go">>>></span>
- </pre></div>
- </div>
- </dd>
- </dl>
- </dd></dl>
- <dl class="staticmethod">
- <dt id="pyechonest.track.track_from_url">
- <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>
- <dd><p>Create a track object from a public http URL.</p>
- <dl class="docutils">
- <dt>Args:</dt>
- <dd>url: A string giving the URL to read from. This must be on a public machine accessible by HTTP.</dd>
- <dt>Example:</dt>
- <dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">>>> </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">"http://www.miaowmusic.com/mp3/Miaow-01-Tempered-song.mp3"</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">t</span>
- <span class="go">< Track ></span>
- <span class="go">>>></span>
- </pre></div>
- </div>
- </dd>
- </dl>
- </dd></dl>
- <dl class="staticmethod">
- <dt id="pyechonest.track.track_from_id">
- <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>
- <dd><p>Create a track object from an Echo Nest track ID.</p>
- <dl class="docutils">
- <dt>Args:</dt>
- <dd>identifier: A string containing the ID of a previously analyzed track.</dd>
- <dt>Example:</dt>
- <dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">>>> </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">"TRWFIDS128F92CC4CA"</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">t</span>
- <span class="go"><track - Let The Spirit></span>
- <span class="go">>>></span>
- </pre></div>
- </div>
- </dd>
- </dl>
- </dd></dl>
- <dl class="staticmethod">
- <dt id="pyechonest.track.track_from_md5">
- <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>
- <dd><p>Create a track object from an md5 hash.</p>
- <dl class="docutils">
- <dt>Args:</dt>
- <dd>md5: A string 32 characters long giving the md5 checksum of a track already analyzed.</dd>
- <dt>Example:</dt>
- <dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">>>> </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">'b8abf85746ab3416adabca63141d8c2d'</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">t</span>
- <span class="go"><track - Neverwas Restored (from Neverwas Soundtrack)></span>
- <span class="go">>>></span>
- </pre></div>
- </div>
- </dd>
- </dl>
- </dd></dl>
- <dl class="staticmethod">
- <dt id="pyechonest.track.track_from_reanalyzing_md5">
- <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>
- <dd><p>Create a track object from an md5 hash, reanalyzing the track first.</p>
- <dl class="docutils">
- <dt>Args:</dt>
- <dd>md5 (str): A string containing the md5 of a previously analyzed track</dd>
- <dt>Example:</dt>
- <dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">>>> </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">'b8abf85746ab3416adabca63141d8c2d'</span><span class="p">)</span>
- <span class="gp">>>> </span><span class="n">t</span>
- <span class="go"><track - Neverwas Restored></span>
- <span class="go">>>></span>
- </pre></div>
- </div>
- </dd>
- </dl>
- </dd></dl>
- </div>
- </div>
- </div>
- </div>
- <div class="sphinxsidebar">
- <div class="sphinxsidebarwrapper">
- <h4>Previous topic</h4>
- <p class="topless"><a href="song.html"
- title="previous chapter">Song – song methods</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="playlist.html"
- title="next chapter">Playlist – playlist methods</a></p>
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/track.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- <div id="searchbox" style="display: none">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" size="18" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
- </div>
- <script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="playlist.html" title="Playlist playlist methods"
- >next</a> |</li>
- <li class="right" >
- <a href="song.html" title="Song song methods"
- >previous</a> |</li>
- <li><a href="index.html">pyechonest v4 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer">
- © Copyright 2010, The Echo Nest.
- Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.5.
- </div>
- </body>
- </html>