We found a solution with Github as a media server. Our URL to MP3 converter stream server serves as an open source for online song downloading or streaming. You can copy the URL of the song you want to download, or paste it to our online MP3 converter website or play it direct as an URL stream in the following script:!
SongURL5 = 'https://raw.githubusercontent.com/maxkleiner/maXbox5/main/assets/Sternenhaufen_Max_SunoAI.mp3';
Tutor152 =
https://github.com/maxkleiner/maXbox5/blob/main/examples/maxbox_starter152_MP3_Sound_Engine.pdf
//'http://www.softwareschule.ch/download/maxbox_starter152.pdf';
var mp3Stream: TMemoryStream;
mp3Stream:= TMemoryStream.create;
Http_GetStream(SongURL5, mp3Stream);
PlayMp3FromStream(mp3stream);
mp3stream.free; //}
A raw GitHub link allows you to access the raw content of a file stored in a GitHub repository. This can be useful for directly accessing files such as images, songs, text files, or scripts without the GitHub interface. We use this also to execute a JavaScript link to run in a local embedding browser in maXbox.
The ComObject CreateOleObject('WMPlayer.OCX') control gives you direct control of media, including reading and writing to the files or metadata/tags.
Additionally, some automation interfaces are implemented by automation objects, and the properties and methods of those interfaces are inherited by the objects like wmp.controls.play.
procedure PlaySurprise_MP3_Media2;
var wmp: Variant;
//Maybe you'll be more comfortable with automation.
//I believe it would provide most of functionality as interfaces provide.
begin
wmp:= CreateOleObject('WMPlayer.OCX');
if ISInternetconnected then begin
wmp.URL:= SongURL5;
wmp.OpenPlayer(wmp.URL);
end else //}
wmp.OpenPlayer(Exepath+'examples\Sternenhaufen_Max_SunoAI.mp3');
//wmp.controls.play;
end;
Top comments (0)