Skip to content

Audio.ReadFile

Name Mandatory Description Default Type
⬅️ Input The input of this shard is ignored. None
Output ➡️ Outputs audio data as an Audio chunk, containing the sample rate, number of samples, number of channels, and the audio samples. Audio
Source No The audio file or bytes to read from (wav,ogg,mp3,flac). none StringVar(String)BytesVar(Bytes)
Channels No An int representing the number of desired output audio channels. 2 Int
SampleRate No An int representing the desired output sampling rate. 44100 Int
Samples No An int representing the desired number of samples in the output. 1024 Int
Looped No A boolean value indicating whether the audio file should be played in loop or should stop the wire when it ends. false Bool
From No A float value representing the starting time in seconds. none FloatVar(Float)None
To No A float value representing the end time in seconds. none FloatVar(Float)None

Experimental/unstable

This API is experimental and might produce unexpected results or crash.

This shard reads audio data from a file or memory buffer. It supports various audio formats including wav, ogg, mp3, and flac. Audio.ReadFile is designed to be used in conjunction with Audio.Device and Audio.Channel to process and play audio in the shards system. It provides the audio data that can be further processed or played through the audio device.