#Speech Recognition in Real-Time

93 messages · Page 1 of 1 (latest)

storm iron
#

hello I am new to C++, someone told me it was good if I wanted to make my code run more quickly, I tried to use python but it was too slow, so I am now trying in C++.

I want to make like a desktop assistant, so I can tell my computer to "open google" (example) and it will recognise my speech. It should be constantly listening (its a console app in microsoft visual studio community), how can I do this?

amber pebbleBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

hollow hatch
#

tbh, i dont know what exactly you are doing in python but it shouldnt be "slow" whatever slow is for you

#

you aren't really doing much in such a program in python, you probably already use a c library for the speech recongition and the opening of stuff is just some os calls

#

those things don't get much faster in c++

storm iron
#

i see

#

so you recommend python?

hollow hatch
#

you probably get much more done with python for now if you dont know anything about c++

storm iron
#

i mean thats true for sure

#

i just wanted c++ for its better speed

hollow hatch
#

what's even slow in your current program?

storm iron
#

i dont really know

#

it just seems like pythons all around slow

hollow hatch
#

well that is certainly true.. but still most of your program is probably handled by c libraries so..

#

first you need to figure out what is slow, to make it faster

storm iron
#

id really prefer C++ tbh

hollow hatch
#

then start by looking for the c++ equivalents of what you are using in python..

storm iron
#

where?

#

ok i will try to do this

#

and come back to u

charred kettle
#

but still most of your program is probably handled by c libraries so
I second this. The speech recognition library you're using is probably written in C/C++

storm iron
#

maybe but its still the python thats slowing it down

#

because sure some of it might be done in C++

#

but theres also the rest in python

hollow hatch
#

mate

#

maybe

#

but you are not doing much in python

#

99% of the time is spent in the c library

#

1% in python

#

i doubt you are really trying to get that 1% speedup

tropic night
storm iron
tropic night
#

Show your code

storm iron
#

well i dont have it at the moment

charred kettle
#

...dude 🙂

storm iron
#

?

charred kettle
#

You're solving a problem that literally doesn't exist

storm iron
#

hmm

charred kettle
#

You think it would run slow, but you didn't make it yet, so you can't even be sure it would be slow

storm iron
#

no i have made it

charred kettle
#

So why do you say you have no code?

storm iron
#

its on another PC

#

but i dont really think this changes the fact id like to make it in C++

#

i do appreciate the input though

hollow hatch
#

i mean just google :p

storm iron
#

i did and it said C++ is faster

hollow hatch
#

whatever you use in python google what the equivalent in c++ is

storm iron
#

oh

#

well i am trying

#

maybe for now i will try to keep pushing through in python if u guys think so

#

thanks for help

charred kettle
#

There's nothing wrong with wanting to rewrite it in C++. If anything, I support that because I like C++ :P

#

Just be honest with yourself on why you're doing that

storm iron
#

yeah I need to learn it for future stuff

#

but C++ is hella difficult

#

i spent 4 hours this morning trying to undersand how my IDE works 😭

charred kettle
#

So what you're stuck on now? Did you figure out how to use some speech recognition library from C++?

#

Did you decide which one you wanna use?

storm iron
#

nope i dont even know how to find them

#

lmaoo

#

i google for c++ speech recognition

#

and i cant really understand most of this

charred kettle
#

Looks promising

storm iron
#

i saw it too

#

but i dont really know how to set stuff like this up

#

cuz for python we just pip install library_name

charred kettle
storm iron
#

thanks

charred kettle
#

It looks like the instructions were written for Linux, but with small changes you should be able to use them on Windows too

#

Instead of sh ./models/download-ggml-model.sh base.en, do models\download-ggml-model.cmd base.en

storm iron
#

oh ok cool

charred kettle
#

It also uses make, but we can try CMake instead of that, since they seem to support it too

#

Tell when you're on that step

storm iron
#

its really late for me tbh

#

i need to sleep

#

i rlly appreciate the help though

#

and i will get to it in the morning

charred kettle
#

👍

amber pebbleBOT
#

@storm iron Has your question been resolved? If so, type !solved :)

final niche
#

Maybe whisper will help but that is kinda slow

cunning nebula
#

you have to write good code for it to be

#

and you can easily fuck up and make your code just as slow as python

#

and you'll also develop severe depression by writing c++ var

final niche
random bone
#

*This only refers to CPython btw, which is basically the default implementation

storm iron
#

ok, after further consideration for the difficulty of C++, I will return to Python and Java for now, and in the future I will learn C++, but for now I will put it off, so I will return here in the future thanks all !

#

!solved

amber pebbleBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity

hollow spire
#

a lot of these python libraries are implemented in C/C++. Sure, you call the functions from python, but internally its all c/c++. so switching out python for c++ isn't going to be beneficial if the way you aproach the problem is bad.

#

as an example, see tensorflow. it is implemented in c++, and the tensorflow stuff that you use are just python bindings for it.