Skip to content

Commit

Permalink
Task #223068 added error handling for audio processing
Browse files Browse the repository at this point in the history
  • Loading branch information
sudeeppr1998 committed Jul 18, 2024
1 parent a4fa95e commit b8c60ce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/utils/VoiceAnalyser.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,14 @@ function VoiceAnalyser(props) {
};

let audioBuf = await blobToArrayBuffer(audioBlob);
let audioBuffer = await context.decodeAudioData(audioBuf);

let audioBuffer;
try {
audioBuffer = await context.decodeAudioData(audioBuf);
} catch (error) {
console.error("Error decoding audio data:", error);
return "";
}

var offlineContext = new OfflineAudioContext(
audioBuffer.numberOfChannels,
Expand Down

0 comments on commit b8c60ce

Please sign in to comment.