Ask coding questions

← Back to all posts
Voice detection in repl
h
Harrison0Home (1)

Can you get a voice input from the user in repl
and if so how would you get it?

thanks

Comments
hotnewtop
Harrison0Home (1)

thanks for responses

Coder100 (18123)
  1. You can't, replit runs on a vm so you can't access microphone.
CodeMaster007 (108)

Yeah. This works when python is running natively, however repl kinda emulates it so it wouldn't work. What I mean by emulate is that if you were to play a ps4 emulated game, you would be able to play it, but not online. Meanwhile if you had a ps4 and played the game, you would be able to play online. The point I'm saying is that in order to use
a mic for repl, you would need to run python off the desktop app. @ch1ck3n

ch1ck3n (2052)

@CodeMaster007 what i meant was make a server using python, upload a mp3 or wave file from a client, the python server process it, and returns a response

CodeMaster007 (108)

The short answer is no. To do speech recognition, repl will need access to your microphone. The problem is that repls run on a servers and not your local device. This makes it impossible to access and use your microphone because the server will only reach what it being used on the cloud or server.

ch1ck3n (2052)

@CodeMaster007 but you can make a client that records voice then upload to your server and process it and return a response to the client

CodeMaster007 (108)

Yeah. But the whole replit runs off servers and in no way can a mic be connected to a server. I tried to do this a few times before and also tried to connect a camera to it, but I had no luck. Has there ever been a repl that done this before though? I haven't heard or seen anything like this. @ch1ck3n

ch1ck3n (2052)

@CodeMaster007 you can just make an html repl and connect to the microphone, record stuff, send it to the server using AJAX, and process it

CodeMaster007 (108)

True. Although for this project he is using python. Not HTML. Good point though! @ch1ck3n

Bunnytoes (142)

I don't think you can