Closed
Bug 1103571
Opened 11 years ago
Closed 8 years ago
audio not play again using mediarecorder api by capturing at interval
Categories
(Firefox OS Graveyard :: General, defect)
Firefox OS Graveyard
General
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: feru007, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0
Build ID: 20141120030202
Steps to reproduce:
According to this link
https://hacks.mozilla.org/2014/06/easy-audio-capture-with-the-mediarecorder-api/
To start recording audio here used
record.onclick = function() {
mediaRecorder.start();
If i use
mediaRecorder.start(2000); // 2sec interval
then it gives data in every 2 sec interval and following event triggered..
mediaRecorder.ondataavailable = function(e) {
var audioURL = window.URL.createObjectURL(e.data);
audio.src = audioURL;
audio.play();
this function will be called which give the audio data in blob (e.data) In this function audio src is set. audio.play() to play that 2 sec recorded audio data.
Actual results:
But it plays only first time . later there is data but data is not playing.. htmlg audio tag didn't play audio after that 1st time.
Expected results:
Expected result is audio will be played in every 2 sec interval here.
Is this a bug or i am missing something ?
Comment 1•11 years ago
|
||
Hi feru,
In mediaRecorder.ondataavailable = function(e),
You should have a blob container to collect the blobs generated from media recorder.
For example:
var mBlob;
function dataavailablecb(aData) {
if (mBlob) {
mBlob = new Blob([mBlob, aData.data], {type: aData.data.type});
} else {
mBlob = new Blob([aData.data], {type: aData.data.type});
}
}
Then you can play the audio sound in mBlob through audio tag.
You could refer this demo web site:
http://people.mozilla.org/~rlin/mr/gumaudio.html
Comment 2•11 years ago
|
||
For opus format, the header would be in the first blob, you can't playback without this information, thanks.
Hi Randy,
Thanks a lot for these informations. I want to capture audio for IP telephony. How can i capture in a format by setting bitrate, audio channel, mono stereo etc? And how to play a fragment of audio bytes? For this can you suggest me any website or project link where i can get help.
thanks
Comment 4•8 years ago
|
||
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•