UNPKG

@miklermpz/expo-audio-studio

Version:

This is a forked version of the original [expo-audio-studio](https://github.com/deeeed/expo-audio-stream/blob/main/packages/expo-audio-studio/README.md) by Arthur Breton <abreton@siteed.net> (https://github.com/deeeed)

19 lines (17 loc) 429 B
import { BitDepth, EncodingType } from '../ExpoAudioStream.types' export const encodingToBitDepth = ({ encoding, }: { encoding: EncodingType }): BitDepth => { switch (encoding) { case 'pcm_32bit': return 32 case 'pcm_16bit': return 16 case 'pcm_8bit': return 8 default: throw new Error(`Unsupported encoding type: ${encoding}`) } }