Skip to content

Commit

Permalink
addressbook
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Jul 21, 2024
1 parent 6afd657 commit 02489d0
Show file tree
Hide file tree
Showing 65 changed files with 464 additions and 5,955 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion application/assets/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,20 @@ export function createAudioRecorder() {
function stopRecording() {
return new Promise((resolve) => {
mediaRecorder.onstop = () => {
const blob = new Blob(recordedChunks, { type: "audio/webm" });
let mimeType = "";

if (MediaRecorder.isTypeSupported("audio/webm; codecs=opus")) {
mimeType = "audio/webm; codecs=opus";
} else if (MediaRecorder.isTypeSupported("audio/ogg; codecs=opus")) {
mimeType = "audio/ogg; codecs=opus";
} else if (MediaRecorder.isTypeSupported("audio/mpeg")) {
mimeType = "audio/mpeg";
} else {
console.warn("No supported MIME type found for audio recording.");
}

const blob = new Blob(recordedChunks, { type: mimeType });

recordedChunks = [];
resolve(blob);
};
Expand Down
Loading

0 comments on commit 02489d0

Please sign in to comment.