mattdiamond / Recorderjs

A plugin for recording/exporting the output of Web Audio API nodes
4.18k stars 1.46k forks source link

Why can not I hear the sound? #10

Open tokgolich opened 11 years ago

tokgolich commented 11 years ago

I do this experiment in Google Chrome Canary 25,Why can not I hear the sound? Code does not prompt error.

First, thanks to everyone Reply.

I do not have change the code. I do it on Windows XP ,not using a web server.

Maybe I can try to experiment in the server.

Then how to ensure that the sampling rate of the input and output device.

cwilso commented 11 years ago

Multiple possibilities: did you enable "Chrome Audio input" in chrome://flags? Are you on Windows or Mac? If Windows, is your input device the same sample rate as your output device?

mattdiamond commented 11 years ago

Yeah so... what exactly is going on here? Could you share some of your code? I'd love to help, but I honestly have no idea how to respond without knowing more about your environment and the code in question.

Thanks!

jaredfolkins commented 11 years ago

A mistake I made was originally opening this example using file:// instead of a web server. The results were exactly as described.

Are you using a web server?

murvinlai commented 11 years ago

same here. I tried the code and run the page as localhost (from my node.js server). After record, it generates some WAV files and not empty. However, it just doesn't record any sound.

When the page is loaded, Chrome asks if I allow or deny audio input, I click "allow". and I also go to chrome://flags and enable Web Audo Input manually.

mattdiamond commented 11 years ago

Hmm... I'll look into this. I wonder if it has anything to do with changes to the Web Audio API. Does anyone have any live examples they can link to?

cwilso commented 11 years ago

Are you on Windows, and if so is the sample rate of your input device set to the same as your output device?

Does a simple getUserMedia sample work, like http://chromium.googlecode.com/svn/trunk/samples/audio/playthrough.html or http://webaudiodemos.appspot.com/input/index.html? (Note those are both loopbacks, so use headphones or they will feed back!)

murvinlai commented 11 years ago

I'm on Mac.

mattdiamond commented 11 years ago

I'm testing our example and it doesn't appear to be working, so there's either a problem with our library or a problem with the example. Still digging into it.

mattdiamond commented 11 years ago

Oops, I'm dumb... recently had my hard drive wiped and I forgot to enable Web Audio Input in Chrome when I reinstalled. The example works fine for me.

Bad news is now I'm not sure why it's breaking for other people.

cwilso commented 11 years ago

Hmm. Murvin, do the other samples I pointed to work for you?

murvinlai commented 11 years ago

Hmmm the Google one is an empty page

and the other one.. does it record? i don't see the button.

On Wed, Jan 2, 2013 at 3:18 PM, Chris Wilson notifications@github.comwrote:

Hmm. Murvin, do the other samples I pointed to work for you?

— Reply to this email directly or view it on GitHubhttps://github.com/mattdiamond/Recorderjs/issues/10#issuecomment-11828977.

cwilso commented 11 years ago

the chromium one is just a straight loopback - you should hear audio input to the output. The input demo one applies various effects (defaults to delay). If you're not getting any audio input to them, the problem isn't recorderJS.

cwilso commented 11 years ago

Actually, you can also try http://webaudiodemos.appspot.com/AudioRecorder/index.html - that's based on recorderJS, but it has a live graphic spectrum analyzer. If you don't see bars bouncing around, it's an input problem.

murvinlai commented 11 years ago

I tried this example. but nothing is recorded. the file size is always 44 byte. I tried to look at the system->sound-> input, i do see the Mac input taking sound from mic.

On Wed, Jan 2, 2013 at 3:44 PM, Chris Wilson notifications@github.comwrote:

Actually, you can also try http://webaudiodemos.appspot.com/AudioRecorder/index.html - that's based on recorderJS, but it has a live graphic spectrum analyzer. If you don't see bars bouncing around, it's an input problem.

— Reply to this email directly or view it on GitHubhttps://github.com/mattdiamond/Recorderjs/issues/10#issuecomment-11829710.

trtg commented 11 years ago

What's the expected degree of functionality in linux right now? I'm using chromium Version 24.0.1312.14 (167497) and while my webcam works when used with the video side of getusermedia and I can hear sound when using the webcam for google hangouts, none of these audio recording or playthrough examples work at all. P.S. yes, I did enable the audio input flag, this is what's running: /usr/lib64/chromium-browser/chrome --type=renderer --enable-webaudio-input --lang=en-US

cwilso commented 11 years ago

Linux audio input is not yet functional.

murvinlai commented 11 years ago

sorry .my bad.. i think something wrong with my mac & chrome. I restart Mac and chrome, then it all works . :)

On Wed, Jan 2, 2013 at 4:39 PM, Chris Wilson notifications@github.comwrote:

Linux audio input is not yet functional.

— Reply to this email directly or view it on GitHubhttps://github.com/mattdiamond/Recorderjs/issues/10#issuecomment-11830947.

mhrrt commented 11 years ago

Can't hear sound from example file.File get created but no audio.

pdindak commented 11 years ago

Version 26.0.1404.0 canary on Windows 7 - recorder.js example does not work, but then again none of the examples in this thread do either. If I go to other google voice pages ( voice to text, mic icon in Chrome itself) they work fine. Must be Canary???? :)

Run that version of Canary on 2 different PCs. Google WebRTC demo works fine on both - audio/video seen and heard. Back to recorder.js in http://webaudiodemos.appspot.com/AudioRecorder/index.html - no input seen

cwilso commented 11 years ago

Likely you didn't enable Web Audio input in chrome://flags, or your input and output devices are not at the same sample rate?

On Tue, Feb 5, 2013 at 5:45 PM, pdindak notifications@github.com wrote:

Version 26.0.1404.0 canary on Windows 7 - recorder.js example does not work, but then again none of the examples in this thread do either. If I go to other google voice pages ( voice to text, mic icon in Chrome itself) they work fine. Must be Canary???? :)

— Reply to this email directly or view it on GitHubhttps://github.com/mattdiamond/Recorderjs/issues/10#issuecomment-13162838.

pdindak commented 11 years ago

Flags was already set. I have two sample modes for the headset I am using - 44100 and 48000. Using the debugger in Chrome, the context sample is always locked to 48000. If I change Windows mic to 48000, still get the same result, recordings with no audio. If I hard code the JS to 44100, same result. Empty recordings. Are you sure the API has not changed?

pdindak commented 11 years ago

Hmm I just found this: Since version 25, Chrome allows audio data from getUserMedia to be passed to an audio or video element (but note that by default the media element will be muted in this case. I think the muted is biting me here. Going to try un- muting it tomorrow.

muaz-khan commented 11 years ago

I used RecorderJs in https://webrtc-experiment.appspot.com/calls/ ( https://github.com/muaz-khan/WebRTC-Experiment/tree/master/audio-recorder ).

See how to share audio-only streams using RTCWeb APIs: https://webrtc-experiment.appspot.com/docs/how-to-share-audio-only-streams.html

It worked fine for me.

pdindak commented 11 years ago

What we found here initially debugging this problem - seems the Audio from the mic into recorderjs already has a RIFF header on it, so we are getting multiple RIFF headers. More to come...........