Use the vessl.Audio class to log audio data. This takes the audio data and saves it as a local WAV file in the vessl-media/audio directory with randomly generated names.
Parameter
Description
data_or_path
Supported types - numpy.ndarray : the audio data
- str: the audio path
sample_rate
The sample rate of the audio file. Required if the numpy.ndarray of audio data is provided as data_or_path
import vesslimport soundfile as sfaudio_path = "sample.wav"data, sample_rate = sf.read(audio_path)# Sample rate is required if numpy.ndarray is provided vessl.log( payload={ "test-audio": [ vessl.Audio(data, sample_rate=sample_rate, caption="audio with data example") ] })