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

MediaStream #109

Open
Centurius123 opened this issue Jul 16, 2017 · 11 comments
Open

MediaStream #109

Centurius123 opened this issue Jul 16, 2017 · 11 comments

Comments

@Centurius123
Copy link

Centurius123 commented Jul 16, 2017

Hey,

I try to send a MediaStream via socket.io-stream, but I dont know how.

Is it possible to do this?

@PMLMonteiro
Copy link

Hi Centurius123

It is definitely possible.
I am currently doing it using the MediaRecorderStream API.
Just grab the stream from navigator.getUserMedia and record it.
You can then pipe the generated stream into an Socket.io-stream stream.

Hope it helps.

@vin-ni
Copy link

vin-ni commented Dec 22, 2017

Have you found a solution to this?

@amber-cd
Copy link

amber-cd commented Jun 20, 2018

Almost a year later, hope I'm not necroposting, but I'm running out of ideas here... has anyone else found a more detailed solution to this? How exactly is someone supposed to use media-recorder-stream to do this? I feel like I'm missing something.

To expand on my use case, I need to stream live audio from a microphone to my service on the back end, which then, using credentials stored in the service, will send that audio stream to an audio transcription service and emit the transcription as it updates. My specific situation here:

  1. I don't want to send to the transcription service directly because it involves a private authentication key and I don't trust the front end with it.
  2. I want this transcription to appear in live time, so it's not sufficient to wait for the MediaRecorderStream to stop and then send a stream with that blob data; I need something which will receive data every time the MediaRecorderStream does, within one stream which is piped to the transcription service.

Which leaves me kind of lost... what am I supposed to do from media-recorder-stream that will be the live equivalent of createBlobReadStream from the audio blob?

(I can create a new issue if need be, or move this to Stack Overflow as is appropriate; this is just the closest to a solution I've found when frantically googling.)

@vin-ni
Copy link

vin-ni commented Jun 20, 2018

Hi @amber-workxpress ,
take a look at this: https://github.com/vin-ni/Google-Cloud-Speech-Node-Socket-Playground
This might be what you're looking for :)

@amber-cd
Copy link

@vin-ni Oh my god, you are a LIFESAVER. Thank you so much; that was exactly what I needed. I had to modify the code a bit to work with my React and Flux-based setup, but this gave me exactly the piece I was missing.

@enahsor
Copy link

enahsor commented Jul 18, 2020

Just in case anyone has a similar issue, WebRTC allows you to do this with its RTCPeerConnection API.

@vin-ni
Copy link

vin-ni commented Jul 20, 2020

Just in case anyone has a similar issue, WebRTC allows you to do this with its RTCPeerConnection API.

could you point to an example?

@enahsor
Copy link

enahsor commented Jul 20, 2020

Sure @vin-ni
https://gist.github.com/enahsor/bacbd4a770e080ae224b7b57894b2224

@enahsor
Copy link

enahsor commented Jul 24, 2020

Sure @vin-ni
https://gist.github.com/enahsor/bacbd4a770e080ae224b7b57894b2224

@vin-ni did it work for you?
@Centurius123 maybe you can try this?

@vin-ni
Copy link

vin-ni commented Jul 27, 2020

Haven't tried it yet. But will once I need something like that the next time and give you feedback!

@Krishnakumarskr
Copy link

Hi @amber-workxpress ,
take a look at this: https://github.com/vin-ni/Google-Cloud-Speech-Node-Socket-Playground
This might be what you're looking for :)

Wow! You are a lifesaver! Thank you so much!. This repository cleared all my doubts.
I have been stuck on many stages while implementing this. Also, I couldn't find helpful answers on StackOverflow. But you did it.
Thanks again!

Some unanswered SO questions:
https://stackoverflow.com/questions/56051454/mediastream-pipe-to-nodejs-socket-io-stream-to-google-speech-api-and-stream-back

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

6 participants