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

Feature Request: How to access generated audio through 2 way talk #618

Open
fuatakgun opened this issue Nov 29, 2023 · 8 comments
Open

Feature Request: How to access generated audio through 2 way talk #618

fuatakgun opened this issue Nov 29, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@fuatakgun
Copy link
Contributor

I want to rely on WebRTC card to activate 2 way audio but I need to get the bytes of generated stream from another custom component, so I can write the respective data into another add-on.

There is eufy-security-ws add-on which is expecting chunks of data to be sent over websocket and I am managing eufy_security custom component.

Do you have any suggestion on how to make this possible?

@fuatakgun
Copy link
Contributor Author

One option, could be, setting up the microphone endpoint (such as tcp address) and my integration can listen on it and forwards incoming bytes into websocket?

@AlexxIT AlexxIT added the enhancement New feature or request label Nov 30, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Nov 30, 2023

  1. This issue for go2rtc, not for this project.
  2. This is difficult system design task. Don't have good ideas yet.

@fuatakgun
Copy link
Contributor Author

I was assuming that this is more about webrtc card/integration which is responsible for capturing the microphone input.

What is the current connection between webrtc card/integration and go2rtc? How are you delivering the audio input into go2rtc?

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 30, 2023

WebRTC Card => WebRTC => go2rtc => any supported two way proto => camera

So you asking about "any supported two way proto => camera" step

@fuatakgun
Copy link
Contributor Author

Do you have code pointer to share about here?

WebRTC => go2rtc

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 30, 2023

@fuatakgun
Copy link
Contributor Author

fuatakgun commented Dec 2, 2023

thanks for the code pointer, assuming getUserMedia is responsible for capturing the microphone and creating the PC as sendonly to go2rtc server, can we introduce an endpoint config on webrtc card attributes to redirect the microphone to an arbitrary http endpoint and I can listen on respective endpoint. I do not want to force users to configure go2rtc manually as the stream will be generated on the fly with your previous HTTP bitstream implementation (which is great by the way, thanks a lot again)

webrtc:

go2rtc:

  • reads the microphone-forward argument and forwards incoming data to respective end point

eufy-security home assistant integration:

  • listens on agreed protocol (http/tcp/websocket/???) and take care of incoming data and forward it to add-on
  • or integration can connect to go2rtc and ask for bytes with continuous request (you can publish them with streaming HTTP response)

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 3, 2023

I think sending mic data to some HTTP endpoint is possible. I don't really like the idea because the solution turns out to be very large and complicated. But in any case I don't have time right now to suggest and implement an alternative.

PS. Remember that audio codec may not suits for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants