Sound API

From iRidium Mobile Wiki
Jump to: navigation, search

DOWNLOAD: Example of a project

IR.PlaySound

This function is used for playing sound files.

Syntax: IR.PlaySound('File_Name',Slot_Number,Volume);

  • File_Name - the name of the sound file
  • Slot_Number – the number of the slot
  • Volume – the volume level
IR.AddListener(IR.EVENT_START,0,function() 
// Event is activated at the application launch
{
 IR.PlaySound('ANGELS_F.WAV',0,50); // Command for playing the sound file
});

IR.StopSound

This function is used to stop playing sound files.

Syntax: IR.StopSound('File_Name');

  • File_Name - the name of the sound file
IR.AddListener(IR.EVENT_START,0,function() 
// Event is activated at the application launch
{
 IR.StopSound('ANGELS_F.WAV'); // Command for stopping the sound file
});

IR.StopSlot

This function is used to stop playing the slot.

Syntax: IR.StopSlot('Slot_Number');

  • Slot_Number - the number of the slot
IR.AddListener(IR.EVENT_START,0,function() 
// Event is activated at the application launch
{
 IR.StopSlot(1) //Command for stopping the slot 1
});

IR.StopAllSounds

This function is used to stop playing all sound files.

Syntax: IR.StopAllSounds();

IR.AddListener(IR.EVENT_START,0,function() 
//Event is activated at the project launch
{
 IR.StopAllSounds(); //Command for stopping all sound files 
});


DOWNLOAD: Example of a project