Эта страница является
переводом страницы
IRidium studio 2019 Sounds. Перевод выполнен на 100%.
Playing sounds and vibration
Indication of presses on items, events and notifications with sound and virbration
Sound and vibration whrn a button is pressed
A sound can be played or a vibration can be activated when an item is pressed on smartphones and tablets with a vibrating motor.
There is a set of commands (macros) to work with sounds in properties of graphical items:
Sound (control of sounds):
- Play Sound [file, track number, volume, cycle]. Start playing an audio-file
- Play System Sound [sound, track number, volume]. Play a standard sound
- Stop Sound [file]. Stop playing an audio-file
- Stop Slot [track number]. Stop playing an audio-file at a selected track
- Stop All Sounds. Stop playing all sounds in the project
More about commands in macros >>>
To use vibration activate the following System token of a project: Device > Vibro. It's available in the list of system tokens. In the time this article was written a tokem could take only 1 value: "vibrate". The vibrations lasts 1 second. The length of vibration can't be changed.
To activate a token when a button is pressed, use Send number to tag macros from Send to project token group. Write 1 in token:
Sound and vibration when an event happens in the system
Any event: change of variable, token, certain time of the day, etc. can be used as an event to play a sound and other actions. A frequent task is to show a popup with a warning and play a sound if there is something wrong in the system, if a call from intercom comes, etc.
An event can be assigned to an action with the help of a simple script.
Example: play a sound, vibrate and open a popup if "1/0/2" feedback channel of "iRidium server" driver becomes 1
IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("iRidium Server"), function(name, value)
{
// if the feedback "1/0/2" of "iRidium server" changes to value 1
if (name == "1/0/2" && value == 1) {
// play sound, all slots, volume: 50
IR.PlaySound('Sounds1_0012.mp3', 0, 50);
// vibration
IR.SetVariable("System.Vibro", true);
// open popup "Alarm"
IR.ShowPopup("Alarm");
}
});
See all types of events and actions in the guide and handbook on JavaScript in iRidium.
Sound of Push-notifications
When i3 pro is opened and maximized on a tablet or smartphone, the sound of a Push-notification is not played and a popyp does not appear.
Not to miss a notification, processing notifications in i3 pro must be set: an interface must show a popup and play a sound when a notification comes. Here is how to do it:
Read 4.1 point of the documentation on setting Push-notifications >>>
IP-cameras with audio support
Some IP cameras, for example, Mobotix can broadcast video stream in mxpeg format, containing an audio track. If you want to play a sound on a page with IP-cameras, put Audio tick in the camera settings:
Other settings of IP-cameras >>>
SIP-intercom: call sound
Ready interfaces for SIP-intercom work with a call sound:
- when i3 pro is open a call sound is played
- when the app is closed you can set a notifiction about the call as a long signal when a Push notification comes:
See solutions for SIP-intercom>>>