createAudioResource

export declare function createAudioResource<Metadata>(input: Readable | string, options: CreateAudioResourceOptions<Metadata> & Pick<Metadata extends null | undefined ? CreateAudioResourceOptions<Metadata> : Required<CreateAudioResourceOptions<Metadata>>, 'metadata'>): AudioResource<Metadata extends null | undefined ? null : Metadata>;
export declare function createAudioResource<Metadata>(input: Readable | string, options: CreateAudioResourceOptions<Metadata> & Pick<Metadata extends null | undefined ? CreateAudioResourceOptions<Metadata> : Required<CreateAudioResourceOptions<Metadata>>, 'metadata'>): AudioResource<Metadata extends null | undefined ? null : Metadata>;
Creates an audio resource that can be played by audio players.
Remarks
If the input is given as a string, then the inputType option will be overridden and FFmpeg will be used.If the input is not in the correct format, then a pipeline of transcoders and transformers will be created to ensure that the resultant stream is in the correct format for playback. This could involve using FFmpeg, Opus transcoders, and Ogg/WebM demuxers.
NameConstraintsOptionalDefaultDescription
MetadataNothe type for the metadata (if any) of the audio resource
NameTypeOptionalDescription
inputReadable | stringNoThe resource to play
optionsCreateAudioResourceOptions<Metadata> & Pick<Metadata extends null | undefined ? CreateAudioResourceOptions<Metadata> : Required<CreateAudioResourceOptions<Metadata>>, 'metadata'>NoConfigurable options for creating the resource