This page is a
translated version of the page
Sound API and the translation is 93% complete.
API iRidium. Sounds
These methods enable adding of sound effects in iRidium projects.
Methods
IR.PlaySound
This function is used for playing sound files.
Syntax
IR.PlaySound(File_Name,Slot_Number,Volume,Loop);
File_Name
|
-
|
type: String the sound file name
|
Slot_Number
|
-
|
type: Number the slot number
|
Volume
|
-
|
type: Number the volume level
|
Loop
|
-
|
type: Boolean enable/disable looping
|
-
Sample
IR.AddListener(IR.EVENT_START,0,function()
//the event which is activated at the app launch
{
IR.PlaySound('ANGELS_F.WAV',0,50,true); //the command for playing sounds
});
IR.StopSound
This function is used to stop playing of sound files.
Syntax
IR.StopSound (File_Name);
File_Name
|
-
|
type: String the sound file name
|
-
Sample
IR.AddListener(IR.EVENT_START,0,function()
//the event which is activated at the application launch
{
IR.StopSound('ANGELS_F.WAV'); //the command to stop playing of sounds
});
IR.StopSlot
This function is used to stop playing of slots
Syntax
IR.StopSlot (Slot_Number);
Slot_Number
|
-
|
type: Number the slot number
|
-
Sample
IR.AddListener(IR.EVENT_START,0,function()
//the event which is activated at the application launch
{
IR.StopSlot(1) //the command to stop playing of slot number 1
});
IR.StopAllSounds
This function is used to stop playing of all sound files
Syntax
IR.StopAllSounds ();
-
Sample
IR.AddListener(IR.EVENT_START,0,function()
//the event which is activated at the application launch
{
IR.StopAllSounds(); //the command to stop playing of all sound files
});
IR.SetAudioSession
Управляет подавлением звуков вне приложения. Например, может остановить фоновую музыку на iOS (Android) устройстве. При отмене подавления звука, музыку нужно включить вручную, и приложение не будет ее останавливать.
Syntax
IR.SetAudioSession(status);
status
|
true
|
type: boolean on/off mute of background sounds
|
-
Sample
IR.AddListener(IR.EVENT_START,0,function()
{
// stop all the background sounds at application start
IR.SetAudioSession(true);
});