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 - MP3 Audio Streaming feature support in SDL_Mixer - Play mp3 from remote (HTTP/FTP)
Summary: MP3 Audio Streaming feature support in SDL_Mixer - Play mp3 from remote (HTTP...
Status: RESOLVED WONTFIX
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.0
Hardware: x86 Linux
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-24 08:11 UTC by Amit Jain
Modified: 2017-10-13 06:03 UTC (History)
1 user (show)

See Also:


Attachments
New API has been added to support mp3 music play from remote (HTTP/FTP) (4.99 KB, patch)
2015-07-24 08:24 UTC, Amit Jain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.