load_audio: Load Audio

View source: R/audio.R

load_audioR Documentation

Load Audio

Description

Decodes an audio or video file with av, downmixed to mono and resampled to 16 kHz.

Usage

load_audio(file)

Arguments

file

Path to an audio or video file in any format FFmpeg reads.

Value

Numeric vector of samples in [-1, 1].

Examples

mp3 <- system.file("samples", "Synapsis-Wonderland.mp3", package = "av")
samples <- load_audio(mp3)
length(samples) / 16000 # seconds

n3d documentation built on Oct. 14, 2026, 5:08 p.m.