Skip to content

Commit

Permalink
Refactor the code
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavrajs committed May 9, 2024
1 parent bda3913 commit 6acecb4
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,12 @@ export default {
async finishRecord() {
let recordedContent = this.player.recordedData;
let fileName = this.player.recordedData.name;
let type = this.player.recorderData.type;
if (this.audioRecordFormat === AUDIO_FORMATS.MP3) {
recordedContent = await convertWavToMp3(this.player.recordedData);
fileName = `${getUuid()}.mp3`;
type = AUDIO_FORMATS.MP3;
}
const type =
this.audioRecordFormat === AUDIO_FORMATS.MP3
? this.player.recordedData.type
: AUDIO_FORMATS.MP3;
const file = new File([recordedContent], fileName, { type });
this.fireRecorderBlob(file);
},
Expand Down

0 comments on commit 6acecb4

Please sign in to comment.