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

onStop and onData not firing #54

Closed
lightninglu10 opened this issue Dec 3, 2018 · 2 comments
Closed

onStop and onData not firing #54

lightninglu10 opened this issue Dec 3, 2018 · 2 comments

Comments

@lightninglu10
Copy link

Hey guys, I'm trying to use this component to record audio. Using Google Chrome as the browser, but onData and onStop are never fired, so I can never access the data that was created.

I see an oscillator and the oscillator moves when voice input is detected, but those other events never fire. Anyone know what's up?

@hackingbeauty
Copy link
Owner

I just installed the latest version of React-Mic, and both onData and onStop worked for me.

You pass callbacks into React-Mic like this:

<ReactMic
  ...
  onStop={this.create}
  onData={this.onData}
  ...
/>

@lightninglu10
Copy link
Author

Sorry I should've closed this earlier. The issue was due to using a polyfill for the mediaRecorder API which has a slightly different API than react-mic is using.

https://github.com/ai/audio-recorder-polyfill

So if anyone uses that polyfill to get React-Mic working on Safari / Edge, then you have to mod the package slightly so that it accepts the right data types and listeners.

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

2 participants