« Happy Birthday Canada! Where's my bike? | Main | Artificial Intelligence? »

Seeking in streamed MP3's!

  • Well, with some insight from Lincoln Stein, author of the Apache::MP3 Perl module, I've successfully implemented seeking in my MP3 engine. Turns out that out of XMMS and WinAMP, only WinAMP supports seeking in HTTP/1.1 streams so far, but XMMS will follow I'm sure. So you can now jump to different parts of a song, even when it's streamed!
  • The trick is that when you move the seekbar in WinAMP to seek in a song, WinAMP sends an HTTP/1.1 header that looks like:


  • Range: bytes=192345-

    to the server, which I can then parse, use the byte offset to do a seek on the file handle, and then send that back to the client.

    w00t! as some might say. :)

    TrackBack

    TrackBack URL for this entry:
    http://www.enfusion-group.org/cgi-bin/mt/mt-tb.cgi/21

    Comments

    ID = 21; $post->blog_id = 1; $post->guid = "seeking_in_streamed_mp3s"; $post->comment_status = "open"; function get_option($option) { $settings = array( "disqus_forum_url" => "enfoto", "disqus_api_key" => "ycbgTTDFptwqNvNKMygOnMx7brM3Darx5GO9iKxluXuEzzcLmrZKVrH36T4bYcKl", "disqus_sort" => "", "disqus_partner_key" => "", "disqus_disable_sync" => "0" ); return $settings[$option]; } function get_permalink() { return "http://www.enfusion-group.org/~adrian/2001/07/seeking_in_streamed_mp3s.html"; } function get_the_title() { return "Seeking in streamed MP3's!"; } function get_the_excerpt() { return "
  • Well, with some insight from Lincoln Stein, author of the Apache::MP3 Perl module, I've successfully implemented seeking in my MP3 engine. Turns out that out of XMMS and WinAMP, only WinAMP supports seeking in HTTP/1.1 streams so far, but XMMS will follow I'm sure. So you can now jump to different parts of a song, even when it's streamed!\r\n
  • The trick is that when you move the seekbar in WinAMP to seek in a song, WinAMP sends an HTTP/1.1 header that looks like:
  • \r\n
    \r\nRange: bytes=192345-\r\n
    \r\nto the server, which I can then parse, use the byte offset to do a seek on the file handle, and then send that back to the client.

    w00t! as some might say. :)"; } function get_the_offset() { return -5; } function start_mt() { include('/var/www/cgi-bin/mt/php/mt.php'); $mt = new MT(1, '/var/www/cgi-bin/mt/mt-config.cgi'); return $mt; } function trackback_url() { return "http://www.enfusion-group.org/cgi-bin/mt/mt-tb.cgi/21"; } include('/var/www/cgi-bin/mt/plugins/disqus/php/disqus.php'); include(dsq_comments_template(1)); ?>

    About

    This page contains a single entry from the blog posted on July 3, 2001 2:18 PM.

    The previous post in this blog was Happy Birthday Canada! Where's my bike?.

    The next post in this blog is Artificial Intelligence?.

    Many more can be found on the main index page or by looking through the archives.