Skip to main content

Audio Node

Audio Node Screenshot

Overview

The Audio Node is used to define an audio sample for use with other nodes. It can also convert a binary type into an audio type.

The Audio Node can either take an input that represents the audio data or use an audio file specified in the node's settings. The audio data should be in a format that can be converted to a Uint8Array.

Inputs

TitleData TypeDescriptionDefault ValueNotes
DatastringThe string representing the audio data.N/AThis input is only available if the "Use Data Input" setting is enabled. The input will be coerced into a string.

Example 1: Using an Audio Node with a File

  1. Add an Audio Node to your graph.
  2. In the node's settings, click "Pick File" and select an audio file from your local file system.
  3. Play the audio back using the player on the Audio node. You may also connect the Audio node to other nodes that accept Audio data, such as the AssemblyAI Plugin

Error Handling

The Audio Node 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.

FAQ

Q: What audio file formats are supported by the Audio Node?

A: The Audio Node does not process the audio data itself, so it does not have any specific audio file format requirements. However, the audio data should be in a format that can be converted to a Uint8Array. The specific audio file formats that can be used will depend on what other nodes you are connecting the Audio Node to.

Q: Can I use the Audio Node to play audio?

A: The Audio Node shows a playback bar on the Rivet UI, but otherwise, it cannot be used to play back audio during the graph's execution.

See Also