We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Voice recognition?
#1
Hi there:

I am trying to write a simple program that can help my father learn to pronounce English better, specifically it will prompt him to pronounce a word and if not recognized then it will not move on to the next word, anyone know of any extensions that can help with voice recognitions for small basics? or any ideas how to go about it another way?

I know it is a big ask, but just hoping if anyone has any ideas.
Reply
#2
(translated by Google translator)

Hello.
Your project looks pretty serious.
I can't suggest anything about this. But I know for sure that if you can achieve your goal using Small Basic, it will be a big plus for the reputation of this programming language.
In this case, be sure to share this success on our forum.  Shy
Reply
#3
I know Microsoft .NET libraries has Microsoft speech API, but since I am only very amateur in programing, I have no idea how to wrap the API into Small basic... May be a complete new extension is needed to utilize the speech API? Not sure. Hopefully someone will have some brilliant ideas for an extension or method of going around it...
Reply
#4
Hi,

There is speech recognition and text to speech in the LDSpeech object of LitDev extension.  There is also a simple example of this that comes with the LitDev download samples in other-samples/SpeechRecognition.sb.

I haven't tested this for ages and you may have to set up MS speech recognition first.

I didn't find it great and and having some issues getting it working now, I will report back if I have any suggestions to help it work.
Reply
#5
Thanks litdev, at least it is a start.

Thank you very much!!!
Reply
#6
One quick question, the ldspeach object, do you know if it will also recognize other languages such as French and/or Japanese? Or only English?

Once again, thanks Litdev for helping out.
Reply
#7
Hi,

I think it should work with diferent languages.  Internally it is initialised using the current windows culture.  This may be set to something other than your default OS culture using LDUtilities.CurrentCulture, and you may have to install and set PC language packs.

It is probably over 10 years since I actually used the code in the sample and it doesn't seem to be working for me using Windows 11.  There has been no code change and it does seem to show that the microphone is being used when it runs, but doesn't seem to detect any speech for me.

If the test sample works for anyone I would be interesetd to know.  If you don't have the sample, then this is it, KLLJ153.000.

EDIT

I did test on another Windows 10 PC and it did work, so my issue is probably to do with my PC somehow.
Reply
#8
LitDev,

Tried your program on a windows 11 laptop. It says microphone in use by tmp8036.tmp. It doesn't work though!

JR
[-] The following 1 user Likes jrmrhrb00's post:
  • litdev
Reply
#9
Hello,
here are a few attempts at LDSpeech
My operating system is WIN7
When I change the German environment to "en-US" using CurrentCulture I get the following message:
   
There is only one output voice on my PC : 1=Microsoft Anna;
I have set up speech recognition on the PC and it works well. However, it is in German.
However, in the Small Basic example program, the OnListen subroutine is never called.
Even if I don't use the dictionary and speak standard words in German and English.
[-] The following 1 user Likes Scout's post:
  • litdev
Reply
#10
Thanks for checking.  There are probably a few things going on.

First, the speech recognition only fires the LDSpeech.Listen event when a match is found., not when it detects speech.  This requires that the word/phrase is resent in LDSpeech.Vocabulary and that the same locale is used to initialise the speech recognition engine and the vocabulary.  In the past I found the default vocabulary pretty poor so it should be set with LDSpeech.Vocabulary.  At present, both locales can only be the same when it is the OS setting locale with same speech recognition locale installed (I don't think using LDUtilities.CurrentCulture will fully work - only being applied to vocabulary with the mismatch maybe being the issue for Scout), so trying to mix or fix locale settings is going to be tricky and I don't want to tackle that till I understand the second issue.

The second issue for me and JR is that it fails on Windows 11 (I always save a SB file to test rather than just running unsaved code that then executes in %temp%).  My sample does work nicely for me using Windows 10.  I tried a simple Console test project on Win 11 and that also worked fine.  However, with the exact same test code copied into LitDev extension and run from SB it fails.  There may be some security/anti-virus issue or something else, but this will require more work on my part to try to determine the cause.  If/when I can get this working I will probably also make it easier to change locales to make it more generic.

Hopefully I will have updated version to test at some point...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)