Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blob & Base64 <audio> not recorded #29

Open
0xAnthony opened this issue May 26, 2024 · 0 comments
Open

Blob & Base64 <audio> not recorded #29

0xAnthony opened this issue May 26, 2024 · 0 comments

Comments

@0xAnthony
Copy link

Hi, it looks like audio tags with base64 and blob src are not recorded.

Here is how I add dynamically the audio :

// Create blob
const mimeType = 'audio/mpeg';
const blob = base64ToBlob(base64, mimeType);
const audioUrl = URL.createObjectURL(blob);

// Create <audio> element
const audio = document.createElement('audio');
const source = document.createElement('source');
source.src = audioUrl;
source.type = mimeType;

// Add element to document
audio.appendChild(source);
document.body.appendChild(audio);
audio.play();

// Dynamically stop & delete element
setTimeout(() => {
    audio.pause();
    document.body.removeChild(audio);
    URL.revokeObjectURL(audioUrl);
}, duration);

Note : The Base64 are valid and this setup works if I just define audio.src to a remote mp3 file.

@0xAnthony 0xAnthony changed the title Blob audio ? Blob & Base64 <audio> not recorded May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant