| 295 | }; |
| 296 | |
| 297 | export 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 | |
| 312 | export const fromAudioSampleFormat = (sampleFormat: AudioSampleFormat): AVSampleFormat => { |
| 313 | switch (sampleFormat) { |