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. Подробнее о загрузке ресурсов

../../_images/image-audio-1.png

Audio files are marked with a characteristic icon

../../_images/image-audio-2.png

Placing the audio file on stage

You can place an audio file on stage in two ways:

  1. Drag an audio file from the “Resources” tab onto the stage
../../_images/image-audio-3.gif
  1. 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
../../_images/image-audio-4.gif

Audio file properties

../../_images/image-audio-5.png
  • Audio - field for selecting a resource

Note

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

Note

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

Note

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

../../_images/image-audio-6.png
  • 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

../../_images/image-audio-7.png

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

../../_images/image-audio-8.png

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

../../_images/image-audio-9.png
  • Playback completed - event triggered after the end of the audio clip