Overview
The Audio Block is used to define an audio sample for use with other blocks. It can also convert a binary type into an audio type. The block can either take an input that represents the audio data or use an audio file specified in the block’s settings.Inputs
The binary data representing the audio. This input is only available if the “Use Data Input” setting is enabled.
Outputs
The audio data converted into a format that can be used by other blocks that accept audio data as input. Contains a Uint8Array of the audio data.
Editor Settings
The audio file to be used as the audio data. This file will be stored as a base64-encoded string and converted to a Uint8Array during execution.
If enabled, the block will use the data from the “Data” input port as the audio data. If disabled, the block will use the data from the audio file specified in the “Audio File” setting.
The width of the block in pixels.
Example: Using an Audio Block with a File
- Add an Audio Block to your flow.
- In the block’s settings, click “Pick File” and select an audio file from your local file system.
Error Handling
The Audio Block will throw an error if:- The “Use Data Input” setting is enabled but no data is provided to the “Data” input port.
- The “Use Data Input” setting is disabled but no audio file is specified in the “Audio File” setting.
- The provided audio data (either from the “Data” input or the specified audio file) cannot be converted to a Uint8Array.
Ensure that the audio data is in a format that can be converted to a Uint8Array to avoid errors.
FAQ
What audio file formats are supported by the Audio Block?
What audio file formats are supported by the Audio Block?
The Audio Block accepts any audio file format (audio/*). However, the audio data should ultimately be convertible to a Uint8Array. The specific audio file formats that can be used will depend on what other blocks you are connecting the Audio Block to.
Can I use the Audio Block to play audio?
Can I use the Audio Block to play audio?
The Audio Block shows a playback bar on the Odella UI, but otherwise, it cannot be used to play back audio during the flow’s execution.

