Open Game Engine 2D API
 All Functions Variables
Functions
Music

Functions

int OGE_PlayMusic (int iLoopTimes)
 Play current music.
int OGE_StopMusic ()
 Stop current music.
int OGE_PauseMusic ()
 Pause the current music.
int OGE_ResumeMusic ()
 Resume current music.
int OGE_PlayMusicByName (string sMusicName, int iLoopTimes)
 Play music by name.
int OGE_FadeInMusic (string sMusicName, int iLoopTimes, int iFadingTime)
 Play music by name with fade in effect.
void OGE_RemoveMusic (string sName)
 Remove music by name.
int OGE_FadeOutMusic (int iFadingTime)
 Let the playing music fade out.
int OGE_GetSound (string sSoundName)
 Get the sound by name.
int OGE_PlaySound (int iSoundCode)
 Play the sound.
int OGE_PlaySoundById (int iSoundId, int iLoopTimes)
 Play the sound by ID.
int OGE_PlaySoundByCode (int iSoundCode, int iLoopTimes)
 Play the sound by code.
int OGE_PlaySoundByName (string sSoundName, int iLoopTimes)
 Play the sound by name.
int OGE_StopSoundById (int iSoundId)
 Stop the sound by ID.
int OGE_StopSoundByCode (int iSoundCode)
 Stop the sound by code.
int OGE_StopSoundByName (string sSoundName)
 Stop sound by name.
int OGE_StopAudio ()
 Stop all sounds and musics.
int OGE_GetSoundVolume ()
 Get the sound volume.
int OGE_GetMusicVolume ()
 Get the music volume.
void OGE_SetSoundVolume (int iValue)
 Set the sound volume.
void OGE_SetMusicVolume (int iValue)
 Set the music volume.

Function Documentation

int OGE_FadeInMusic ( string  sMusicName,
int  iLoopTimes,
int  iFadingTime 
)

Play music by name with fade in effect.

Parameters:
[in]sMusicNameThe name of the music
[in]iLoopTimesThe play times
[in]iFadingTimeThe time of fading in
Returns:
Returns a non-nagative number if succeed
int OGE_FadeOutMusic ( int  iFadingTime)

Let the playing music fade out.

Parameters:
[in]iFadingTimeThe time of fading out
Returns:
Returns a non-nagative number if succeed

Get the music volume.

Returns:
The music volume
int OGE_GetSound ( string  sSoundName)

Get the sound by name.

Parameters:
[in]sSoundNameThe name of the sound
Returns:
The ID of the sound

Get the sound volume.

Returns:
The sound volume
int OGE_PauseMusic ( )

Pause the current music.

Returns:
Returns a non-nagative number if succeed
int OGE_PlayMusic ( int  iLoopTimes)

Play current music.

Parameters:
[in]iLoopTimesThe play times
Returns:
Returns a non-negative number if succeed
int OGE_PlayMusicByName ( string  sMusicName,
int  iLoopTimes 
)

Play music by name.

Parameters:
[in]sMusicNameThe name of the music
[in]iLoopTimesThe play times
Returns:
Returns a non-nagative number if succeed
int OGE_PlaySound ( int  iSoundCode)

Play the sound.

Parameters:
[in]iSoundCodeThe code of the sound
Returns:
Returns a non-nagative number if succeed
int OGE_PlaySoundByCode ( int  iSoundCode,
int  iLoopTimes 
)

Play the sound by code.

Parameters:
[in]iSoundCodeThe code of the sound
[in]iLoopTimesThe play times
Returns:
Returns a non-nagative number if succeed
int OGE_PlaySoundById ( int  iSoundId,
int  iLoopTimes 
)

Play the sound by ID.

Parameters:
[in]iSoundIdThe ID of the sound
[in]iLoopTimesThe play times
Returns:
Returns a non-nagative number if succeed
int OGE_PlaySoundByName ( string  sSoundName,
int  iLoopTimes 
)

Play the sound by name.

Parameters:
[in]sSoundNameThe name of the sound
[in]iLoopTimesThe play times
Returns:
Returns a non-nagative number if succeed
void OGE_RemoveMusic ( string  sName)

Remove music by name.

Parameters:
[in]sNameThe name of the music
int OGE_ResumeMusic ( )

Resume current music.

Returns:
Returns a non-nagative number if succeed
void OGE_SetMusicVolume ( int  iValue)

Set the music volume.

Parameters:
[in]iValueThe music volume
void OGE_SetSoundVolume ( int  iValue)

Set the sound volume.

Parameters:
[in]iValueThe sound volume
int OGE_StopAudio ( )

Stop all sounds and musics.

Returns:
Returns a non-nagative number if succeed
int OGE_StopMusic ( )

Stop current music.

Returns:
Returns a non-negative number if succeed
int OGE_StopSoundByCode ( int  iSoundCode)

Stop the sound by code.

Parameters:
[in]iSoundCodeThe code of the sound
Returns:
Returns a non-nagative number if succeed
int OGE_StopSoundById ( int  iSoundId)

Stop the sound by ID.

Parameters:
[in]iSoundIdThe ID of the sound
Returns:
Returns a non-nagative number if succeed
int OGE_StopSoundByName ( string  sSoundName)

Stop sound by name.

Parameters:
[in]sSoundNameThe name of the sound
Returns:
Returns a non-nagative number if succeed