Audio
A standard Varwin object that is used to configure audio files. This is a “technical” object - it is not displayed to the player in playback mode, but its blocks are triggered according to the selected logic
After importing an audio file into the platform resources, it will appear in the Desktop editor on the “Resources” tab
Audio files are marked with a characteristic icon
Placing the audio file on stage
You can place an audio file on stage in two ways:
- Drag an audio file from the “Resources” tab onto the stage
- Add an “Audio” object to the scene, and then assign it a resource to play from the resource selection window in the properties of the object in the Inspector
Audio file properties
- Audio - field for selecting a resource
Supported formats: ogg, wav
- Looping - repeatedly plays the audio file after it is finished
- Play on start - starts the audio file immediately after the scene is initialized
- Volume (0-1) - Setting the volume of the audio file between 0 and 1, where
- 0 is silent
- 1 is the maximum volume
The parameter supports input of fractional numbers in x.y format
Playback speed - Set the speed of the audio file in the range from 0 to 3, where:
0 - no playback
1 - playback of the file at the original speed
3 - the maximum three times speed
The parameter supports input of fractional numbers in x.y format
- Mute audio - mutes the audio file in the scene
- 3D sound - mutes the surround playback of the audio file. The source of the sound will depend on the location of the user relative to the Audio object on the stage
- Press the “Play” button to listen to the audio file in the editor
- Button “Stop” - to stop listening to the audio file in the editor
Blockly
The main interaction with the audio file takes place inside the built-in Blockly logic editor
The following block types are set by default for the object:
Logic
- Audio playing/paused/stopped at the moment - a block that is embedded in the logical construction and is involved in checking the current state of the audio file
Actions
This set of actions allows you to manipulate the playback of an audio file and includes
- Play/Stop/Pause audio
- Rewind for X seconds - set the playback time to the specified
Variables
Contains blocks that specify and return values of the following audio file attributes:
- Cycled/non-cycled playback
- Loudness [0-1]
- Playback speed [0-3]
- Audio duration in seconds
- Current time - get the current time value
Events
- Playback completed - event triggered after the end of the audio clip