MCPcopy Create free account
hub / github.com/Vanilagy/webcodecs-polyfill / toAudioSampleFormat

Function toAudioSampleFormat

src/misc.ts:297–310  ·  view source on GitHub ↗
(ffmpegSampleFormat: AVSampleFormat)

Source from the content-addressed store, hash-verified

295};
296
297export const toAudioSampleFormat = (ffmpegSampleFormat: AVSampleFormat): AudioSampleFormat | null => {
298 switch (ffmpegSampleFormat) {
299 case AV_SAMPLE_FMT_U8: return 'u8';
300 case AV_SAMPLE_FMT_S16: return 's16';
301 case AV_SAMPLE_FMT_S32: return 's32';
302 case AV_SAMPLE_FMT_FLT: return 'f32';
303 case AV_SAMPLE_FMT_U8P: return 'u8-planar';
304 case AV_SAMPLE_FMT_S16P: return 's16-planar';
305 case AV_SAMPLE_FMT_S32P: return 's32-planar';
306 case AV_SAMPLE_FMT_FLTP: return 'f32-planar';
307
308 default: return null;
309 }
310};
311
312export const fromAudioSampleFormat = (sampleFormat: AudioSampleFormat): AVSampleFormat => {
313 switch (sampleFormat) {

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected