Retrieve audio metadata.

torchaudio_info(filepath)

Arguments

filepath

(str) path to the audio file.

Value

AudioMetaData: an R6 class with fields sample_rate, channels, samples.

Examples

path <- system.file("waves_yesno/1_1_0_1_1_0_1_1.wav", package = "torchaudio")
torchaudio_info(path)
#> <AudioMetaData>
#>   Public:
#>     clone: function (deep = FALSE) 
#>     initialize: function (sample_rate, num_frames, num_channels) 
#>     num_channels: 1
#>     num_frames: 46960
#>     sample_rate: 8000