Hello again, I have successfully run pocketsphinx and created my own language model to recognize only basic words like "forward", "backward" etc.
I would like to ask, is it possible to link pocketsphinx to arduino to control a robotic project? (like sending serial).
I tried to google it but i can't seem to find any good tutorial..
environment: 32bit windows 7, pocketsphinx0.8, sphinxbase0.8, arduino IDE
thanks in advance.
Last edit: Yansen 2013-06-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, you can just open a serial device and write commands there directly
I'm starting to get the idea: pocketsphinx -> send serial -> write commands on serial device.
One thing I'm still wondering: I do know to write commands on the serial device (in my case, the arduino), but I lack of knowledge on how to send the serial from pocketsphinx. Wonder if I can inquire about how to send the serial from pocketsphinx?
Last edit: Yansen 2013-06-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I do know to write commands on the serial device (in my case, the arduino), but I lack of knowledge on how to send the serial from pocketsphinx.
You do not send commands from pocketpshinx, you send them from your application. Your application interacts with pocketphinx and with serial port, pocketsphinx doesn't interact with serial port directly, only by means of your application.
Wonder if I can inquiry about how to send the serial from pocketsphinx?
You write to serial from your application, not from pocketsphinx. You can find a lot on this topic in Google, for example things like this:
The difference is, in the link i provided, it uses 'button' in visual basic to send the number "1" or "0" through serial to arduino.
Meanwhile, I'm trying to figure out how to serially send the number "1" to arduino if pocketsphinx recognizes the word 'forward'.
Since pocketsphinx is built with Visual Studio, I'm supposing there is a way to modify pocketsphinx's code with Visual Studio to achieve this?
My apologies for bugging you with tons of questions. I'm trying hard to learn.
Thanks!
Last edit: Yansen 2013-06-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
By 'application', do you refer to arduino IDE or perhaps the builder of pocketsphinx (Visual Studio) ?
By application I mean the program you are writing
Since pocketsphinx is built with Visual Studio, I'm supposing there is a way to modify pocketsphinx's code with Visual Studio to achieve this?
When you write software you write your own code, you do not modify the code of the library
Instead of exitting when 'GOODBYE' is recognized, I mean to send a serial..
The code is not very different:
/* Exit if the first word spoken was GOODBYE */
if (hyp) {
sscanf(hyp, "%s", word);
if (strcmp(word, "OFF") == 0) {
serial_port_t *port = serial_open(port);
serial_write(port, "1');
serial_close(port);
}
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello again, I have successfully run pocketsphinx and created my own language model to recognize only basic words like "forward", "backward" etc.
I would like to ask, is it possible to link pocketsphinx to arduino to control a robotic project? (like sending serial).
I tried to google it but i can't seem to find any good tutorial..
environment: 32bit windows 7, pocketsphinx0.8, sphinxbase0.8, arduino IDE
thanks in advance.
Last edit: Yansen 2013-06-17
Yes, you can just open a serial device and write commands there directly or you can use any suitable library through it's API.
Not every thing in this world have tutorial for it, sometimes you need to think yourself.
Thanks for replying.
I'm starting to get the idea: pocketsphinx -> send serial -> write commands on serial device.
One thing I'm still wondering: I do know to write commands on the serial device (in my case, the arduino), but I lack of knowledge on how to send the serial from pocketsphinx. Wonder if I can inquire about how to send the serial from pocketsphinx?
Last edit: Yansen 2013-06-17
You do not send commands from pocketpshinx, you send them from your application. Your application interacts with pocketphinx and with serial port, pocketsphinx doesn't interact with serial port directly, only by means of your application.
You write to serial from your application, not from pocketsphinx. You can find a lot on this topic in Google, for example things like this:
http://www.ladyada.net/learn/arduino/lesson4.html
Last edit: Nickolay V. Shmyrev 2013-06-17
Thanks for the link provided. It is helpful.
By 'application', do you refer to arduino IDE or perhaps the builder of pocketsphinx (Visual Studio) ?
What I'm trying to accomplish is similar to: http://www.instructables.com/id/Using-Visual-Basic-to-control-Arduino-Uno/
The difference is, in the link i provided, it uses 'button' in visual basic to send the number "1" or "0" through serial to arduino.
Meanwhile, I'm trying to figure out how to serially send the number "1" to arduino if pocketsphinx recognizes the word 'forward'.
Since pocketsphinx is built with Visual Studio, I'm supposing there is a way to modify pocketsphinx's code with Visual Studio to achieve this?
My apologies for bugging you with tons of questions. I'm trying hard to learn.
Thanks!
Last edit: Yansen 2013-06-18
For instance, inside continuous.c there is this line:
Instead of exitting when 'GOODBYE' is recognized, I mean to send a serial..
By application I mean the program you are writing
When you write software you write your own code, you do not modify the code of the library
The code is not very different: