Skip to content
Function

getEncodableAudioCodecs

ts
getEncodableAudioCodecs(
	checkedCodecs: AudioCodec[] = AUDIO_CODECS as unknown as AudioCodec[],
	options?: {
		/** The number of audio channels. */
		numberOfChannels?: number;
		/** The sample rate in hertz. */
		sampleRate?: number;
		/** The desired quality of the encoded audio. */
		quality?: Quality;
		/**
		 * The target bitrate for the encoded audio, in bits per second. Alternatively, a {@link Quality} can
		 * be provided.
		 * @deprecated Use `quality` instead.
		 */
		bitrate?: number | Quality;
	},
): Promise<AudioCodec[]>;

Returns the list of all audio codecs that can be encoded by the browser.

See AudioCodec, AUDIO_CODECS, and Quality.

Released under the Mozilla Public License 2.0.