How can I send audio data from a microphone to an API? - api

I would like to use an API that checks pronunciation. Its input is audio. I would like to achieve the following: the user speaks to the microphone - an audio file is generated - and it is sent to the API. The API sends back the answer - the evaluation of the pronunciation. How can achieve this?
I would be also interested in how to display the microphone for the users.
My main aim is to make it work in a browser.
Thank you very much for your answer.
I couldn't set up the audio recording yet.

Related

alternate for Youtube Api

Within my organization YouTube playback service is ban. I can get title, description and all the details about any YouTube video but unable to stream it on my system. Is there any solution that can help without using VPN? any alternate YouTube API?? or Something else. (I just want to avoid that video playback session that google API generate while streaming any video on client server side )
Any help will be appreciated.
Edited***
I am adding this picture for your understanding enter image description here
I just don't want this VideoPlayback session thing.

How to get "mute" state of all users in the channel? [agora.io]

I have a Voice Call in which I would like to have a little overlay showcasing which users have their audio muted. Is there a callback I can use to know whether users have locally muted their stream?
I have not found a way to do this directly using agora.io's library.
You can use the onRemoteAudioStateChanged API: https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a24fd6b0d12214f6bc6fa7a9b6235aeff

Twilio: test speaker/microphone

Using Twilio, how can I create a JS widget that can listen to the microphone and output its sound through the speakers, as a loopback?
Twilio developer evangelist here.
I don't believe you need Twilio for that. You can just use the getUserMedia API to capture a user's microphone and then play it back with an HTML5 <audio> tag.
I'd like to recommend you don't do this though. Whilst building video chats and testing with myself, the feedback is horrible and no-one wants to experience it!

Stream audio from Microphone in IOS

I am trying to get audio from the microphone and stream it across as data through socket to a node server. Since I haven't really done this before, I am confused on how to do this properly.
First of all, how do you actually stream data from a specific microphone? I need the audio to be streamed, not recorded then sent. In other words, it needs to be like a call, where the word you say is automatically sent to to the recipient rather than recorded, then sent as some sort of recording.
Second of all, how do I specify where the audio comes in? I have seen some questions about this but I couldn't find a good solution to how to do this, especially for my case, where the audio input is from the lightening audio.
I couldn't find a good example of how to do this using AVAudioSession. Is there any good resources (examples, tutorials) that I can use to help me?
Thanks!

Streaming web video to Roku

Does anyone know how technically to send videos (i.e. Youtube Videos) to a Roku player? There is a "Twonky Beam" app that allows streaming and what it appears to do is to send .mp4 files to Roku for playback. See the demo here: http://gigaom.com/video/youtube-on-roku-twonky-airplay/
This is done without a "Twonky Beam" Roku app. Looks like something that Roku supports natively, although I cannot find anything documented.
I want to know how they were able to accomplish this without Roku being a UPNP or DLNA device.
Any insights here would be great!
There are discussions on how to extract the mp4 URL from YouTube here and here
In terms of how to do airplay style video playback on Roku, you would use the External Control Protocol to launch a channel with the URLs of the video you wish to play back, or once your channel is launched, us the ECP in combination with the roInput component to send the URL's to your channel. Your channel would then send the URLs to a video playback compoenent which would initiate playback from Youtube or whatever source you send it. If you want to play URL's from your device (android/IOS) you would need to run a web server on the device to serve videos to the device.
here is an Open Source YouTube project referenced in that second thread.
Any unofficial project that plays video's from YouTube is subject to DMCA takedown by YouTube should they decide your project does not fit with their goals.
roInput is not really well documented, here is an example that demonstrates both roInput and launch parameters (launch parameters are keywords you include in an http POST):
function main(params as object)
if params.parameter <> invalid then
print "This channnel was launched with Launch Parameters!"
print params
else
print "launched without input parameters"
end if
port=CreateObject("roMessagePort")
input=createobject("roInput")
input.setmessageport(port)
while true
msg=wait(100,port)
if type(msg)="roInputEvent" then
params=msg.getinfo()
print params
end if
end while
end function
so your parameters might be "vidurl=http://myserver.com/video300k.mp4&vidurl=http://myserver.com/video600k.mp4" if you wanted to send multiple bit rate videos.
there are plenty of examples of how to play video on a Roku in the RokuSDK, the simplest being the simplevideoplayer exmaple.
As to the last part of the question re UPNP, you can find a roku on your lan either via brute force telnet on port 8060 to every ip or by using SSDP, also documented in the ECP guide linked above