Sound Blocks
Last updated
Last updated
The sound blocks enable you to integrate various audio elements into your app. These blocks allow you to incorporate sounds like music, effects, or recorded audio to enhance the user experience. By using sound blocks, you can create engaging and interactive app environments that include auditory elements.
Each of the first four blocks in the sound blocks drawer has a regular and advanced block. When you first drag one of these blocks into your workspace it will be the regular version. To access the advanced version:
Add the block to your workspace.
Right-click on it.
Select Show advanced block.
The advanced blocks return an "error" output block. If there is an error when executing the block, the error block will return an error message. If not, the error block will return a null value.
The "play" block plays a selected sound. This can be an audio file uploaded to your project or a URL that streams audio.
The "pause" block pauses the audio file currently playing.
The "resume" block resumes the audio file that was previously paused.
The "stop" block stops the audio file that is currently playing. A sound that has been stopped cannot be resumed using the "resume" block.
The "is paused?" block returns true if the named sound file has been played and then paused. Otherwise, it returns false.
The "sound file from recording" block records for the specified number of seconds and then returns the recorded audio.
The "start recording" block starts an untimed audio recording.
The "sound file from stopped audio recording" block stops a recording initiated by the "start recording" block and returns the recorded sound file.