File tree Expand file tree Collapse file tree
src/app/plugins/voice-recorder-kit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,27 +60,18 @@ export function getSupportedAudioCodec(): string | null {
6060 * This is used to ensure that the recorded audio file has the correct extension based on the codec used for recording.
6161 */
6262export function getSupportedAudioExtension ( codec : string ) : string {
63- switch ( codec ) {
64- case 'audio/ogg;codecs=opus' :
65- case 'audio/ogg;codecs=vorbis' :
66- case 'audio/ogg;codecs=speex' :
63+ const baseType = codec . split ( ';' ) [ 0 ] . trim ( ) ;
64+ switch ( baseType ) {
6765 case 'audio/ogg' :
6866 return 'ogg' ;
69- case 'audio/webm;codecs=opus' :
7067 case 'audio/webm' :
7168 return 'webm' ;
7269 case 'audio/mp4' :
73- case 'audio/mp4;codecs=aac' :
7470 return 'm4a' ;
7571 case 'audio/mpeg' :
7672 return 'mp3' ;
77- case 'audio/wav;codecs=1' :
7873 case 'audio/wav' :
7974 return 'wav' ;
80- // silly webkit stuff
81- case 'audio/mp4;codecs=mp4a.40.2' :
82- case 'audio/mp4;codecs=mp4a.40.5' :
83- return 'm4a' ;
8475 case 'audio/aac' :
8576 return 'aac' ;
8677 default :
You can’t perform that action at this time.
0 commit comments