RSPMP3
Class MP3Player

This is the main MP3 player class with the exported functions

The documentation has detailed information about the functions

Field Summary
int WAVE__MAPPER
         This constant will define the wave mapper ( -1) to be used with the function setwaveoutdevice

Constructor Summary
MP3Player()
         This is the main MP3 player class with the exported functions

Method Summary
void close()
        It will close the mp3 file and stop the playback
string controlname()
         It will retrieve the name of the library , in this case RSP MP3 Player .Net 1.1.0
void Finalize()
         MP3 player destructor
int getbitrate()
         This function will retrieve the bitrate of the mp3 file , for vbr files the bitrate will change during the playback , it is normal
int getfilelength()
         getfilelength will retrieve the size of the mp3 file in bytes
int getlasterror()
        This function will retrieve the last error ocurred in both open and play functions , the open and play function will return immediately but the internal player is running and the unique way to know what have occurred during the playback of the mp3 file is calling this function after the event that will be raised at the end of the playback called , so just check for the errorcode when the finish event is raised , look in the C# sample code for how to implement this kind of verification
string getlasterrorstring(int errocode)
        This function will retrieve the description of the errorcode passed , it is useful to see what have generated the error during the playback
string getlayer()
         The function getlayer will retrieve a string with the number of the MPEG1 layer , valid values are I II and III
int getmp3lengthseconds()
         getmp3lengthseconds will retrieve the total number of seconds of the mp3 file
int getmp3lengthtime()
         getmp3lengthtime will retrieve the time of the playback as an int
int getnumberofwaveoutdevices()
         The getnumberofwaveoutdevices function will retrieve the number of wave out devices in the system , if 0 , then no valid soundcards are installed in the system
int getpercentposition()
        getpercentposition will retrieve the playback position as a percentage , 0 to the beginning of the playback and 100 in the end of playback , it is useful to update the playback position in a slider
int getsamplerate()
         The function getsamplerate will retrieve the sample rate of the mp3 file
int getseconds()
        This function will retrieve the number of seconds of the playback
string getstereomode()
         getstereomode will retrieve the description of the stereo mode used in the creation of the mp3 file , it can be single channel , dual channel , joint stereo or stereo
string gettimemp3string()
         gettimemp3string will retrieve the total time of the mp3 as a formatted string
string gettimeplayedstring()
        gettimeplayedstring will retrieve the time elapsed of the playback as a formatted string
string getwaveoutdevicename(int devicenumber)
         The function getwaveoutdevicename will retrieve the name of the sound card referred to the device number
void goto_rspsoftware()
        It will just start your default browser and connect you to our primary homepage at http://rspsoftware.clic3.net
int isvbr()
        isvbr will retrieve whether the file is a Xing VBR mp3 file or not , notice that VBR is deprecated , and not all players support this encode format
int open(string filename)
         It will open the media file , and prepare it to play
void passcallback(RSPMP3.MP3Player.UpdateForm function)
        This function will pass the delegate created in the form with the function that will receive the event execution , in this case the function will be called after each 1000 milliseconds to update the form and the playback slider , if no function is passed , this function will just do nothing and your player will just not receive any update from the internal player
void passfinishevent(RSPMP3.MP3Player.UpdateForm function)
        This function will receive the delegate created in the form with the function that will receive a call in the end of execution of the player as an event , it is useful to inform about the end of the playback to the form using the MP3 library
void pause()
         It will pause the playback
void play(string filename)
         It will open the media file , and play it immediately
void resume()
        It will resume the playback
int setplaybackpercentposition(int newvalue)
         It will change the playback position , the valid value range from 0 to 100 , 0 to the beginning , 100 to the end of the mp3 file , it is useful to set the playback position using a slider
int setwaveoutdevice(int newvalue)
         The setwaveoutdevice will define what soundcard will play the mp3 file , pass -1 to use the wave mapper (wave mapper is the first valid wave out device installed) , or use the valid wave out devices installed in the system , 0 to the first soundcard and so on
int status()
        It will retrieve the status of the player , if 1 , then a mp3 file is loaded , if 0 , then no mp3 file is loaded

Methods inherited from class System.Object
Equals, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

WAVE__MAPPER

public int WAVE__MAPPER

This constant will define the wave mapper ( -1) to be used with the function setwaveoutdevice

passing it to the function to define the wave out will force the application to use the default soundcard in the system to play the mp3 file

Constructor Detail

MP3Player

public MP3Player()

This is the main MP3 player class with the exported functions

The documentation has detailed information about the functions

Method Detail

close

public void close()

It will close the mp3 file and stop the playback


controlname

public string controlname()

It will retrieve the name of the library , in this case RSP MP3 Player .Net 1.1.0


Finalize

protected void Finalize()

MP3 player destructor

.


getbitrate

public int getbitrate()

This function will retrieve the bitrate of the mp3 file , for vbr files the bitrate will change during the playback , it is normal


getfilelength

public int getfilelength()

getfilelength will retrieve the size of the mp3 file in bytes


getlasterror

public int getlasterror()

This function will retrieve the last error ocurred in both open and play functions , the open and play function will return immediately but the internal player is running and the unique way to know what have occurred during the playback of the mp3 file is calling this function after the event that will be raised at the end of the playback called , so just check for the errorcode when the finish event is raised , look in the C# sample code for how to implement this kind of verification

Notice that an error 0 means no error , only errors different of 0 are real errors occured


getlasterrorstring

public string getlasterrorstring(int errocode)

This function will retrieve the description of the errorcode passed , it is useful to see what have generated the error during the playback


getlayer

public string getlayer()

The function getlayer will retrieve a string with the number of the MPEG1 layer , valid values are I II and III


getmp3lengthseconds

public int getmp3lengthseconds()

getmp3lengthseconds will retrieve the total number of seconds of the mp3 file


getmp3lengthtime

public int getmp3lengthtime()

getmp3lengthtime will retrieve the time of the playback as an int


getnumberofwaveoutdevices

public int getnumberofwaveoutdevices()

The getnumberofwaveoutdevices function will retrieve the number of wave out devices in the system , if 0 , then no valid soundcards are installed in the system


getpercentposition

public int getpercentposition()

getpercentposition will retrieve the playback position as a percentage , 0 to the beginning of the playback and 100 in the end of playback , it is useful to update the playback position in a slider


getsamplerate

public int getsamplerate()

The function getsamplerate will retrieve the sample rate of the mp3 file


getseconds

public int getseconds()

This function will retrieve the number of seconds of the playback


getstereomode

public string getstereomode()

getstereomode will retrieve the description of the stereo mode used in the creation of the mp3 file , it can be single channel , dual channel , joint stereo or stereo


gettimemp3string

public string gettimemp3string()

gettimemp3string will retrieve the total time of the mp3 as a formatted string


gettimeplayedstring

public string gettimeplayedstring()

gettimeplayedstring will retrieve the time elapsed of the playback as a formatted string


getwaveoutdevicename

public string getwaveoutdevicename(int devicenumber)

The function getwaveoutdevicename will retrieve the name of the sound card referred to the device number


goto_rspsoftware

public void goto_rspsoftware()

It will just start your default browser and connect you to our primary homepage at http://rspsoftware.clic3.net


isvbr

public int isvbr()

isvbr will retrieve whether the file is a Xing VBR mp3 file or not , notice that VBR is deprecated , and not all players support this encode format


open

public int open(string filename)

It will open the media file , and prepare it to play

You need to call resume in order to initiate the playback , in case of errors the function RSPMP3.MP3Player.getlasterror can be used to retrieve the error number and the function RSPMP3.MP3Player.getlasterrorstring(System.Int32) can be used to retrieve the description of the error


passcallback

public void passcallback(RSPMP3.MP3Player.UpdateForm function)

This function will pass the delegate created in the form with the function that will receive the event execution , in this case the function will be called after each 1000 milliseconds to update the form and the playback slider , if no function is passed , this function will just do nothing and your player will just not receive any update from the internal player


passfinishevent

public void passfinishevent(RSPMP3.MP3Player.UpdateForm function)

This function will receive the delegate created in the form with the function that will receive a call in the end of execution of the player as an event , it is useful to inform about the end of the playback to the form using the MP3 library


pause

public void pause()

It will pause the playback


play

public void play(string filename)

It will open the media file , and play it immediately

In case of errors the function RSPMP3.MP3Player.getlasterror can be used to retrieve the error number and the function RSPMP3.MP3Player.getlasterrorstring(System.Int32) can be used to retrieve the description of the error


resume

public void resume()

It will resume the playback


setplaybackpercentposition

public int setplaybackpercentposition(int newvalue)

It will change the playback position , the valid value range from 0 to 100 , 0 to the beginning , 100 to the end of the mp3 file , it is useful to set the playback position using a slider


setwaveoutdevice

public int setwaveoutdevice(int newvalue)

The setwaveoutdevice will define what soundcard will play the mp3 file , pass -1 to use the wave mapper (wave mapper is the first valid wave out device installed) , or use the valid wave out devices installed in the system , 0 to the first soundcard and so on


status

public int status()

It will retrieve the status of the player , if 1 , then a mp3 file is loaded , if 0 , then no mp3 file is loaded