|
ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Inputs and outputs > Speakers > Speaker actions
Speaker actions

Introduction
As you may know, a procedure can include actions, some of which can affect a speaker - these are detailed below.
Actions
| Switch the speaker on | Start the speaker playing. The speaker will play the current source at the current volume for the current duration (if set). If the speaker is already playing, this action will have no effect. |
| Switch the speaker off | Stops the speaker playing. If the speaker was set to play for a set duration, and that duration has not passed yet, then the speaker will still stop playing and the duration timer will be reset. If the speaker is not playing, this action will have no effect. |
| Set speaker volume | Changes the speaker volume to the volume specified in the action's parameter. The volume is set as a percentage (see this topic for full details about specifying speaker volume). If the speaker is playing, the volume will change immediately, otherwise the new volume will be used next time the speaker starts playing. |
| Make speaker source a tone | Changes the speaker source to a tone of the frequency specified in the action's parameter. The frequency is specified in hertz. If the speaker is already playing a tone, this action will change the tone's frequency immediately. If the speaker is playing white noise or a sound file, then the speaker will change to play the specified tone. If the speaker is not playing, then the next time it starts playing, it will play a tone of the specified frequency. |
| Make speaker source white noise | Changes the speaker source to white noise. If the speaker is already playing white noise this action has no effect. If the speaker is playing a tone or a sound file, it will change to play white noise. If the speaker is not playing then, the next time it starts playing, it will play white noise. |
| Make speaker source a sound file (played repeatedly) | |
Changes the speaker source to the sound file specified in the action's parameter. The parameter is the full path and file name of the file and can be any valid Windows file path. If the speaker is playing a sound file, it will change to play the file specified in the action's parameter. If the same file is specified as the one which is playing, the file will restart from the beginning. If the speaker is playing a tone or white noise, it will change to play the sound file. If the speaker is not playing, then the next time it starts playing, it will play the sound file. The file will play repeatedly.
| Make speaker source a sound file (played once) | |
Changes the speaker source to the sound file specified in the action's parameter. The parameter is the full path and file name of the file and can be any valid Windows file path. If the speaker is playing a sound file, it will change to play the file specified in the action's parameter. If the same file is specified as the one which is playing, the file will restart from the beginning. If the speaker is playing a tone or white noise, it will change to play the sound file. If the speaker is not playing, then the next time it starts playing, it will play the sound file. The file will play just once, i.e. when playback reaches the end of the file, the speaker will switch off.
| Set speaker playback duration | Sets the duration for which the speaker will play to the duration specified in the action's parameter. The duration can be any time value and can include units of ms (milliseconds), s (seconds), min or m (minutes), h (hours) or d (days); if no units are specified seconds are assumed. If the parameter is 0, the speaker will have no duration and will play continuously until explicitly switched off. If the speaker is playing, the playback duration will be reset to the new duration starting from the moment the duration is changed. For example, if a speaker is playing a tone for 10s, and 8s after it starts playing this action is used to set the duration to 5s, the speaker will play for another 5s from now. If a speaker is playing a sound file just once, and the playback duration is longer than the sound file duration, the speaker will stop playing at the end of the file, i.e. the duration will have no effect. If the speaker is not playing when this action is performed, then the speaker will play for the specified duration the next time it starts playing. |

© Copyright 2003-2026 Stoelting Co. All rights reserved
ANY-maze help topic T0216
|