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 and 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 for the object by default:

Action blocks

This set of action blocks allows you to manipulate the playback of an audio file and includes:

  1. Playback
  2. Stopping playback
  3. Enabling pause during playback
  4. Resuming playback
  5. Restoring the original playback speed
  6. Rewind one second N
  7. Muting the sound
  8. Turning the sound on

Function blocks

This category includes two blocks that return the following values when queried:

  • Audio file duration in seconds;
  • The current playback time of the audio file.

Variables

Contains blocks that specify and return values of the following audio file attributes:

  • Loop
  • Playback at start
  • Volume (0-1)
  • Speed (0-3)
  • Playback check

Events

Event that is triggered when audio file playback ends.