Skip to content

createAudioResource

createAudioResource<T>(input, options?): AudioResource<T>

Defined in: packages/voice/src/resource.ts:379

Creates an AudioResource from a file path, a URL (FFmpeg), bytes, a ReadableStream or an async iterable.

Ogg/Opus input is played as it is (passthrough). PCM input, and anything with inlineVolume, is encoded with Opus (opusscript, an optional peer). Other formats go through FFmpeg, which is killed when the resource ends or is destroyed.

T = unknown

AudioInput

AudioResourceOptions<T> = {}

AudioResource<T>