createAudioResource
declare function createAudioResource<T>(input: string | Readable, options: CreateAudioResourceOptions<T> & Pick<T extends null | undefined ? CreateAudioResourceOptions<T> : Required<CreateAudioResourceOptions<T>>, 'metadata'>): AudioResource<T extends null | undefined ? null : T>;
declare function createAudioResource<T>(input: string | Readable, options: CreateAudioResourceOptions<T> & Pick<T extends null | undefined ? CreateAudioResourceOptions<T> : Required<CreateAudioResourceOptions<T>>, 'metadata'>): AudioResource<T extends null | undefined ? null : T>;
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.Name | Constraints | Optional | Default | Description |
---|---|---|---|---|
T | No | None |
Name | Type | Optional | Description |
---|---|---|---|
input | string | Readable | No | The resource to play |
options | CreateAudioResourceOptions<T> & Pick<T extends null | undefined ? CreateAudioResourceOptions<T> : Required<CreateAudioResourceOptions<T>>, 'metadata'> | No | Configurable options for creating the resource T - the type for the metadata (if any) of the audio resource |