<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: mp3</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/mp3.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2010-02-01T09:58:47+00:00</updated><author><name>Simon Willison</name></author><entry><title>HTML 5 audio player demo</title><link href="https://simonwillison.net/2010/Feb/1/audio/#atom-tag" rel="alternate"/><published>2010-02-01T09:58:47+00:00</published><updated>2010-02-01T09:58:47+00:00</updated><id>https://simonwillison.net/2010/Feb/1/audio/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://jszen.blogspot.com/2010/01/html-5-audio-player-demo.html"&gt;HTML 5 audio player demo&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Scott Andrew’s experiments with the HTML5 audio element (and jQuery)—straight forward and works a treat in Safari, but Firefox doesn’t support MP3. Presumably it’s not too hard to set up a fallback for Ogg.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/audio"&gt;audio&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/firefox"&gt;firefox&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/html5"&gt;html5&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/javascript"&gt;javascript&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/jquery"&gt;jquery&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mp3"&gt;mp3&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ogg"&gt;ogg&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/safari"&gt;safari&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/scott-andrew"&gt;scott-andrew&lt;/a&gt;&lt;/p&gt;



</summary><category term="audio"/><category term="firefox"/><category term="html5"/><category term="javascript"/><category term="jquery"/><category term="mp3"/><category term="ogg"/><category term="safari"/><category term="scott-andrew"/></entry><entry><title>DRM-free MP3 downloads from Amazon</title><link href="https://simonwillison.net/2007/Sep/25/sil/#atom-tag" rel="alternate"/><published>2007-09-25T16:30:11+00:00</published><updated>2007-09-25T16:30:11+00:00</updated><id>https://simonwillison.net/2007/Sep/25/sil/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.kryogenix.org/days/2007/09/25/drm-free-mp3-downloads-from-amazon"&gt;DRM-free MP3 downloads from Amazon&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
The good: they have what looks like the entire Universal and EMI catalogues in DRM-free 256bit MP3s. The bad: you need a US billing address! So close...


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/amazon"&gt;amazon&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/drm"&gt;drm&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/emi"&gt;emi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mp3"&gt;mp3&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stuart-langridge"&gt;stuart-langridge&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/universal"&gt;universal&lt;/a&gt;&lt;/p&gt;



</summary><category term="amazon"/><category term="drm"/><category term="emi"/><category term="mp3"/><category term="stuart-langridge"/><category term="universal"/></entry><entry><title>Audio Fingerprinting for Clean Metadata</title><link href="https://simonwillison.net/2007/Sep/13/lastfm/#atom-tag" rel="alternate"/><published>2007-09-13T17:46:54+00:00</published><updated>2007-09-13T17:46:54+00:00</updated><id>https://simonwillison.net/2007/Sep/13/lastfm/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.last.fm/2007/08/29/audio-fingerprinting-for-clean-metadata"&gt;Audio Fingerprinting for Clean Metadata&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Last.fm have started using audio fingerprints to help clean up misspelled artists and duplicate track information.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/audio"&gt;audio&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/audiofingerprinting"&gt;audiofingerprinting&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/lastfm"&gt;lastfm&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/metadata"&gt;metadata&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mp3"&gt;mp3&lt;/a&gt;&lt;/p&gt;



</summary><category term="audio"/><category term="audiofingerprinting"/><category term="lastfm"/><category term="metadata"/><category term="mp3"/></entry><entry><title>Flash MP3 Player</title><link href="https://simonwillison.net/2007/Feb/25/flash/#atom-tag" rel="alternate"/><published>2007-02-25T02:13:50+00:00</published><updated>2007-02-25T02:13:50+00:00</updated><id>https://simonwillison.net/2007/Feb/25/flash/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.jeroenwijering.com/?item=Flash_MP3_Player"&gt;Flash MP3 Player&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Nice little embeddable MP3 player, with support for single files or Atom/XSPF/RSS playlists.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/flash"&gt;flash&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mp3"&gt;mp3&lt;/a&gt;&lt;/p&gt;



</summary><category term="flash"/><category term="mp3"/></entry><entry><title>Extracting the length from MP3 files with Python</title><link href="https://simonwillison.net/2003/Dec/4/mp3lengths/#atom-tag" rel="alternate"/><published>2003-12-04T02:20:40+00:00</published><updated>2003-12-04T02:20:40+00:00</updated><id>https://simonwillison.net/2003/Dec/4/mp3lengths/#atom-tag</id><summary type="html">
    &lt;p&gt;Ned Batchelder &lt;a href="http://www.nedbatchelder.com/blog/200311.html#e20031102T135849" title="Reading mp3 metadata"&gt;recently wrote&lt;/a&gt; about the difficulties involved in extracting the length from an MP3 file. We're going to need to solve this problem soon at work; luckily, it seems that the answer may lie in the Python bindings for &lt;a href="http://www.mpgedit.org/mpgedit/"&gt;mpgedit&lt;/a&gt;, an audio file editing library available for both Windows and Linux.&lt;/p&gt;

&lt;p&gt;After installing the &lt;a href="http://www.mpgedit.org/mpgedit/download_sdks.html"&gt;Windows package&lt;/a&gt; and experimenting for a while, I managed to extract the time from one of my test files using the following:&lt;/p&gt;

&lt;pre&gt;&lt;code class="python"&gt;&amp;gt;&amp;gt;&amp;gt; import mpgedit
&amp;gt;&amp;gt;&amp;gt; play = mpgedit.Play('example.mp3')
&amp;gt;&amp;gt;&amp;gt; play.total_time()
(213, 129)
&amp;gt;&amp;gt;&amp;gt; secs, msecs = play.total_time()
&amp;gt;&amp;gt;&amp;gt; mins = secs / 60
&amp;gt;&amp;gt;&amp;gt; secs = secs - mins * 60
&amp;gt;&amp;gt;&amp;gt; print "%d:%02d minutes" % (mins, secs)
3:33 minutes
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;However, for other files &lt;code class="python"&gt;total_time()&lt;/code&gt; is returning &lt;code class="python"&gt;(-1, -1)&lt;/code&gt;. I'm sure there's a solution to this but I haven't stumbled across it yet.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/mp3"&gt;mp3&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="mp3"/><category term="python"/></entry></feed>