Audio
less than a minute
class Audio
W&B class for audio clips.
method Audio.__init__
__init__(
data_or_path: Union[str, pathlib.Path, list, ForwardRef('np.ndarray')],
sample_rate: Optional[int] = None,
caption: Optional[str] = None
)
Accept a path to an audio file or a numpy array of audio data.
Args:
data_or_path
: A path to an audio file or a NumPy array of audio data.sample_rate
: Sample rate, required when passing in raw NumPy array of audio data.caption
: Caption to display with audio.
classmethod Audio.durations
durations(audio_list)
Calculate the duration of the audio files.
classmethod Audio.sample_rates
sample_rates(audio_list)
Get sample rates of the audio files.
Feedback
Was this page helpful?
Glad to hear it! If you have more to say, please let us know.
Sorry to hear that. Please tell us how we can improve.