join webRTC with listen audio user only . not need Access granted to audio or video - socket.io

i use this code
https://github.com/anoek/webrtc-group-chat-example/blob/master/client.html
But I want when the visitor enters, he can hear only others
if i stop and video getUserMedia This is not allowed
navigator.mediaDevices.getUserMedia({"audio":USE_AUDIO, "video":USE_VIDEO})
What is the solution

Related

How to connect a voice stream websocket (goal is Google Voice API) to a Twimlets Conference

In my existing app we use the https://www.twilio.com/labs/twimlets/conference feature :
var strURI = "http://twimlets.com/conference?Name=" + channelId.ToString() + "&Message=Welcome&Music=http://bter.com/radio/radio2.xml";
TwilioClient.Init(_twilioConfiguration.AccountSid, _twilioConfiguration.AuthToken);
var application = await ApplicationResource.CreateAsync(voiceUrl:new Uri(strURI), friendlyName: channelId.ToString());
My app then allows users in their browser to join in a special audio conference bridge to participate in training. It does not involve any phone number.
We have a need to route the stream to the Google Speech to Text API so we can use a custom dictionary.
In the examples I have found, and exercised
twilio phone-numbers:update 14805551212 --voice-url http://b74c35a792ff.ngrok.io
It seems like the phone number is configured in Twilio so that on connecting it opens a web socket stream to the endpoint (a ngrok endpoint proxy is common in the examples) .
In my situation, I wish to programmatically tell the dynamically created conference room to open a voice stream to a specific endpoint (for example http://b74c35a792ff.ngrok.io).
Is there an API call I can make to Twilio or additional settings I can add to the twimlets.com/conference to achieve this?
Twilio developer evangelist here.
When you set up a phone number with a voice URL in Twilio it doesn't connect via web sockets. Instead, when a phone call is made to the Twilio number it will make an HTTP request, a webhook, to the voice URL you provide. Similarly, when you create a new call via the REST API and provide a URL, Twilio will make an HTTP request to that URL when the call connects.
In both instances, Twilio is asking your application for instructions for what to do next. Those instructions are supplied by responding to the HTTP request with a subset of XML called TwiML. The XML elements and attributes describe what Twilio should do next with the call, like speaking a message, playing an audio file, gathering user input or dialling another number or into a conference.
When you use the Conference Twimlet, the URL you are providing returns TwiML to direct the call into a conference.
The Conference Twimlet does not provide any way to stream the audio from it. In fact, conferences in general do not make it easy to get the audio unless you literally dial into the conference itself. You could set up to stream the audio of each of the conference participants to your own websocket server by forking their audio before they join the conference using <Start><Stream> before redirecting to the conference Twimlet.
Sorry this isn't a full answer, but hope it helps.

Play an audio sound to a specific speaker group on my Alexa when pressing a button

I am trying to get Alexa to play an audio sound to a specific speaker group on a button press. I have a doorbell button which is hooked up to my Raspberry Pi. I can detect when the button is physically pressed on the Pi so from here I want to some how issue a command to Alexa to play an mp3 file to a pre-configured speaker group (everywhere). Is this possible?
The Pi has node-red and MQTT installed so REST Requests are no problem!
The simple answer is no. The interaction with Alexa is user initiative most of the time. That means, user starts a conversation and then Alexa speaks or plays an audio. The only times that Alexa wakes up on its own is when there is a reminder or a notification (Proactive Events API). The Proactive Events API allows you to send notifications to users of your skill. When your skill successfully sends a notification to a user’s Alexa device, the user hears a chime sound that indicates a notification has arrived. The user can then say, “Alexa, read my notifications” and hear the details.
So, for your use case, it is not possible to wake Alexa to play the mp3 file as result of pressing a button.

How to record audio & video of user in skype real time media calling?

I want to ask questions to the user and record his response, like a IVR bot but I want to record both audio and video of the user. Is it possible to do that with real time media calling?
I had gone through the samples, but I did not understand on how to specify when to record the audio/video.
IVR bots are audio-only, they do not support video. Video is supported with a real-time media bot.
A real-time media bot can record the audio and video streams (and, ideally, notify the Skype caller that it may be recording the call). We do not provide a full sample showing this scenario. There is an answer for similar question on the GitHub site:
In a 1:1 Skype video call with your real-time media bot, the bot has
access to the Skype caller's audio and video. The Huebot sample shows
a bot receiving the audio and video of the Skype caller. To create a
recording, the bot could save the contents of audio and video media
buffers to disk and use a tool like ffmpeg to process them into an MP4
file, for example. But there's no specific recording sample. Also note
that the bot cannot control what resolution it receives of the Skype
caller's video, and will likely get a low resolution such as 240p.
Hope this help!!

DTMF during playback in Freeswitch via ESL

In FreeSWITCH, would it be possible to capture DTMF without interrupting sound playback? play_and_get_digits app stops playback as soon as the required keypress is obtained.
I am trying to do this via ESL, hence session.stream wouldn't work. Have tried bind_digit_action, but it doesn't work at all while the sound is being played. Lastly, bind_meta_app wouldn't work as it requires a meta keypress like *, which messes up with the requirement.
You should be able to subscribe to events for a specific session and catch the DTMF events while playback or any other application is running.

Reacting to UserAction in AudioPlayerAgent when app is suspended

I have an audio player that uses BackgroundAudioPlayer together with AudioPlayerAgent. Everything is working fine, except there's one use case I don't know how to handle.
If I play an audio track in my application and then the user switches to another application, the audio track continues to play in the background as it should - but I guess my application has now been swapped to memory and is suspended.
My question is: if the user now starts to play music in another app, I do get the AudioPlayerAgent.UserAction.Stop action as a callback to my AudioAgent. But can I do anything about this now from my app's point of view? I mean, I would like to save the position of the audio playback where the user was in my app, but my app has been suspended, right?
When my app is in the foreground and the audio stops, I do get the BackgroundAudioPlayer.Instance.PlayerState.Stopped event. It's here that I normally save the position of the playback. But if the user switches to another app to play music, I don't get this event.
So I am just wondering how to handle this kind of case. Is there anything I can do to improve the user experience?
The only way is to save that Position to Isolated Storage in the agent code.
See this very useful article of Paul about how to use Background audio agent and the way to communicate between UI and agent side

Resources