We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3070

Summary: MP3 Audio Streaming feature support in SDL_Mixer - Play mp3 from remote (HTTP/FTP)
Product: SDL_mixer Reporter: Amit Jain <amit.jain83>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2 CC: amit.jain83
Version: 2.0.0   
Hardware: x86   
OS: Linux   
Attachments: New API has been added to support mp3 music play from remote (HTTP/FTP)

Description Amit Jain 2015-07-24 08:11:03 UTC
Current Limitation:
      1. There is no way to play mp3 file from HTTP/FTP using SDL_mixer API. 
      2. Game Developers have to use multiple APIs of smpeg library to   
         play/pause/resume mp3 from remote (HTTP/FTP).

There should be an API in SDL_mixer that can be used by Game developer to play mp3 file from remote (HTTP/FTP).
Comment 1 Amit Jain 2015-07-24 08:24:39 UTC
Created attachment 2225 [details]
New API has been added to support mp3 music play from remote (HTTP/FTP)

Extension API has been provided in SDL_mixer to support mp3 streaming.

  Mix_Music *Mix_LoadMUS_Remote(int socketDescriptor, Mix_MusicType type)
  [IN] - socketDescriptor - Socket descriptor - TCP Socket, user will create SockFD from URL where mp3 file is located. 
  [IN] - type - Type of music.
  [out] - returns Mix_Music structure pointer on success & NULL if fail.

   This API is responsible for following things.
     1. Load Music type = mp3 from Remote & return Mix_Music structure.
     2. Mix_Music structure pointer will be used to play remote mp3 using mixer APIs.

Result: Game developers can now directly use SDL_mixer APIs to play/pause/resume mp3 from HTTP/FTP (streaming) using above API.
Comment 2 Amit Jain 2015-08-03 06:16:49 UTC
Hello Sam  & Ryan

Please review & provide your Feedback.

Please let me know for any doubt.

Thanks 
Amit Jain
Comment 3 Sam Lantinga 2017-10-13 06:03:37 UTC
Probably a better way to handle this is to create a new type of SDL_RWop that wraps a network socket, that way all the loaders would be able to use it seamlessly. That seems like it might be a good thing to put in the core SDL library.