LoadInternetStream method
Remarks
Loads a song from the Internet or from a Shoutcast/Icecast server.
Accepted stream formats are: MP1, MP2, MP3, MP4 (***), AIFF, AAC, AC3, FLAC, WAV, OGG Vorbis, WMA (*), ASF (**) and WMV (**)
MOD formats are not accepted: if you want to play MOD music downloaded from the Internet, you should download the MOD file into local memory (for example using the Microsoft WININET API) and then use the
LoadSoundFromMemory method.
In case you should be downloading a single file (not a radio stream), once the download completes the
DownloadComplete event will be fired: if for example you need to retrieve the ID3V1 tag of a downloaded MP3 file, information available only on the latest bytes of the file, you could use this event to trigger the availability of the needed Tag.
Once the downloaded stream or file has enough playable data, the control will fire the
StreamLoaded event.
Syntax
|
[Visual Basic]
control.LoadInternetStream (
nPlayer as Integer,
strURL as String
|
|
[C++]
short control.LoadInternetStream (
short nPlayer,
LPCTSTR strURL
);
|
|
Parameter
|
Description
|
|
|
|
|
nPlayer
|
Number representing the zero-based index of the player that will load the sound
|
|
strURL
|
String containing the URL of the stream to load. Accepted URLs begin with "http://", "ftp://" or "mms://".
Passing an empty string will cause to cancel any previous call to the LoadInternetStream method.
|
Return value
|
Value
|
Meaning
|
|
|
|
|
enumErrorCodes.NOERROR (0)
|
The method call was successful.
|
|
Negative value
|
An error occurred: see the LastError property for further error details or for a list of the possible error values.
|
(*) Requires Microsoft Windows Media Format modules already installed on the target PC
(**) Performs only sound tracks (no video): requires Microsoft Windows Media Format modules already installed on the target PC
(***) Performs only sound tracks (no video)
The Windows Media Format modules can be installed using the redistribution setup package (wmfdist.exe) provided by Microsoft. Details about the integration of these modules inside your own setup package can be found on the following link of the official Microsoft web site (note that in the future this link could change due to the Microsoft site maintenance).