Posts: 21
Threads: 4
Likes Received:
3 in 3 posts
Likes Given: 0
Joined: Sep 2023
Reputation:
0
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.
Posts: 21
Threads: 4
Likes Received:
3 in 3 posts
Likes Given: 0
Joined: Sep 2023
Reputation:
0
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...
Posts: 451
Threads: 34
Likes Received:
359 in 246 posts
Likes Given: 178
Joined: Aug 2023
Reputation:
17
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.
Posts: 21
Threads: 4
Likes Received:
3 in 3 posts
Likes Given: 0
Joined: Sep 2023
Reputation:
0
Thanks litdev, at least it is a start.
Thank you very much!!!
Posts: 21
Threads: 4
Likes Received:
3 in 3 posts
Likes Given: 0
Joined: Sep 2023
Reputation:
0
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.
Posts: 451
Threads: 34
Likes Received:
359 in 246 posts
Likes Given: 178
Joined: Aug 2023
Reputation:
17
09-19-2024, 02:56 PM
(This post was last modified: 09-19-2024, 04:16 PM by litdev.)
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.
Posts: 136
Threads: 10
Likes Received:
37 in 31 posts
Likes Given: 29
Joined: Oct 2023
Reputation:
3
LitDev,
Tried your program on a windows 11 laptop. It says microphone in use by tmp8036.tmp. It doesn't work though!
JR
Posts: 451
Threads: 34
Likes Received:
359 in 246 posts
Likes Given: 178
Joined: Aug 2023
Reputation:
17
09-19-2024, 11:35 PM
(This post was last modified: 09-19-2024, 11:37 PM by litdev.)
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...