Copyright © 2005-2010 MultiMedia Soft

LoadInternetStream method

Previous pageReturn to chapter overviewNext page

Remarks

 

Loads a song from the Internet or from a Shoutcast/Icecast server.

 

Accepted stream formats are: MP1, MP2, MP3, WAV, AIFF, 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.

 

A successful call to this method will fire the DownloadBuffering event.

 

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.

 

For further details about Internet streams support see the How to play Internet streams section.

 

 

Syntax

 

[Visual Basic]

Public Function LoadInternetStream (

nPlayerIndex as Int16,

strURL as String

) as enumErrorCodes


 

[C#]

public enumErrorCodes LoadInternetStream (

Int16 nPlayerIndex,

string strURL

);


 

[C++]

public: enumErrorCodes LoadInternetStream (

Int16 nPlayerIndex,

string strURL

);


 

 

Parameter

Description

 

 

nPlayerIndex

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 song file has been loaded successfully.

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

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).