maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [DEVEL] Saera: Siri clone for Maemo5, Harmattan and Sailfish OS (https://talk.maemo.org/showthread.php?t=84753)

Jannis 2013-06-23 08:47

Re: Voice control for Maemo5 and Harmattan
 
Quote:

Originally Posted by javispedro (Post 1353982)
That's great, specially if you let pocketsphinx know the current mode's reduced vocabulary & grammar.

That's the case.

Jannis 2013-06-26 20:17

Re: [DEVEL] Saera: Siri clone for Maemo5 and Harmattan
 
1 Attachment(s)
[ -- See next page for a newer version -- ]

Here is an early version of my "Voicy".
It has to be installed manually.

Please install:
- pocketsphinx-utils
- pocketsphinx-hmm-en-hub4wsj
- pocketsphinx-lm-en-hub4
- gstreamer0.10-pocketsphinx
- python-gst0.10
- python-gtk2
- python-gobject
- python-cairo
- espeak
- xdotool
- Python module ConfigParser
(Untar and run: python setup.py install)

Create the directory /home/user/.voicy , it is needed to store a configuration file.

See also the Readme.txt

I hope it works for you ...


@taixzo: If you like, we could perhaps merge our programs somehow. Anyhow, feel free to make use of the dictionary switching if you like.

rfeese 2013-06-27 18:17

Re: [DEVEL] Saera: Siri clone for Maemo5 and Harmattan
 
@Jannis: I'm trying to run this but I'm getting the following errors:

opt/voicy $ ./voicy.py
Can't open /sys/class/leds/lp5523:r/brightness
Can't open /sys/class/leds/lp5523:r/brightness
Can't open /sys/class/leds/lp5523:r/brightness
debug info: can't parse config.ini-file, taking default values
Can't open /sys/class/leds/lp5523:r/brightness
Can't open /sys/class/leds/lp5523:r/brightness
Traceback (most recent call last):
File "./voicy.py", line 344, in <module>
app = VoicyGUI()
File "./voicy.py", line 60, in __init__
VoicyCore.__init__(self)
File "/opt/voicy/VoicyCore.py", line 43, in __init__
self.init_gst()
File "/opt/voicy/VoicyCore.py", line 107, in init_gst
+ '! fakesink')
glib.GError: no element "vader"
/opt/voicy $

oops...
OK, it looks like I'm missing some gstreamer and other libraries.

Jannis 2013-06-27 21:04

Re: [DEVEL] Saera: Siri clone for Maemo5 and Harmattan
 
Quote:

Originally Posted by rfeese (Post 1355195)
@Jannis: I'm trying to run this but I'm getting the following errors:

opt/voicy $ ./voicy.py
Can't open /sys/class/leds/lp5523:r/brightness

The program setLED must have set the SUID-bit (see ReadMe.txt)
enter as root: chmod u+s setLED

Jannis 2013-07-20 15:31

Re: [DEVEL] Saera: Siri clone for Maemo5 and Harmattan
 
Has anyone managed to test voicy?

I would like to know, whether there is a demand for other particular voicy-control functionalities.

impeham 2013-08-16 20:44

Re: [DEVEL] Saera: Siri clone for Maemo5 and Harmattan
 
Quote:

Originally Posted by Jannis (Post 1360418)
Has anyone managed to test voicy?

I would like to know, whether there is a demand for other particular voicy-control functionalities.

Well - i'm trying to:

copied all files to /opt/voicy, enabled all permissions and launched - "[root /opt/voicy]# python ./voicy.py"

but i'm getting this error from the console:

---
debug info: can't parse config.ini-file, taking default values
Traceback (most recent call last):
File "./voicy.py", line 344, in <module>
app = VoicyGUI()
File "./voicy.py", line 60, in __init__
VoicyCore.__init__(self)
File "/opt/voicy/VoicyCore.py", line 43, in __init__
self.init_gst()
File "/opt/voicy/VoicyCore.py", line 107, in init_gst
+ '! fakesink')
glib.GError: no element "vader"
---

[Edit]
after installing "gstreamer0.10-pocketsphinx" this error is gone, but i'm getting a new one when starting voicy.py:

---
Traceback (most recent call last):
File "./voicy.py", line 344, in <module>
app = VoicyGUI()
File "./voicy.py", line 60, in __init__
VoicyCore.__init__(self)
File "/opt/voicy/VoicyCore.py", line 43, in __init__
self.init_gst()
File "/opt/voicy/VoicyCore.py", line 111, in init_gst
asr.connect('result_score', self.asr_result_score)
TypeError: <__main__.GstPocketSphinx object (asr) at 0x4118f0>: unknown signal name: result_score
---

lexik 2013-08-17 09:19

Re: [DEVEL] Saera: Siri clone for Maemo5 and Harmattan
 
Great piece of software!

When you are talking about A.I., you probably mean that Siri-like-semi-A.I. If we want the true A.I. we have to use artifical neural network. A few examples:
  • PyBrain
  • FANN

PyBrain is too complex and heavyweight - but really simple to use.
FANN must be compiled [DONE] before use. It is written is C but have binding for python. That means it is way faster than PyBrain.

Nowadays i'm trying to get PyBrain working, and modify Saera a little to make her "intelligent" :)

However this is just extremely-experimental and with N900 HW it will probably be slow-unusable'n'battery-killer. But who knows :)

EDIT: HERE is an .deb package with FANN library compiled in scratchbox.
For now no python-binding, but just let me some time (or do it yourself). It is an old (2.1.0, last update was 2.2.0) version, you can compile the new one with cmake 2.8 which can be found somewhere on the forum.

Jannis 2013-08-18 08:42

Re: [DEVEL] Saera: Siri clone for Maemo5 and Harmattan
 
Quote:

Originally Posted by impeham (Post 1367763)

[Edit]
after installing "gstreamer0.10-pocketsphinx" this error is gone, but i'm getting a new one when starting voicy.py:

---
Traceback (most recent call last):
File "./voicy.py", line 344, in <module>
app = VoicyGUI()
File "./voicy.py", line 60, in __init__
VoicyCore.__init__(self)
File "/opt/voicy/VoicyCore.py", line 43, in __init__
self.init_gst()
File "/opt/voicy/VoicyCore.py", line 111, in init_gst
asr.connect('result_score', self.asr_result_score)
TypeError: <__main__.GstPocketSphinx object (asr) at 0x4118f0>: unknown signal name: result_score
---

Sorry for that error.
Please either use the patched version of pocketsphinx (it's included in the zip file) or change the line in VoicyCore.py

Code:

asr.connect('result_score', self.asr_result_score)
into
Code:

try:
    asr.connect('result_score', self.asr_result_score)
except:
    self.print_debug("patched version of pocketsphinx not installed")


impeham 2013-08-20 02:13

Re: [DEVEL] Saera: Siri clone for Maemo5 and Harmattan
 
Quote:

Originally Posted by Jannis (Post 1367994)
Sorry for that error.
Please either use the patched version of pocketsphinx (it's included in the zip file) or change the line in VoicyCore.py

Code:

asr.connect('result_score', self.asr_result_score)
into
Code:

try:
    asr.connect('result_score', self.asr_result_score)
except:
    self.print_debug("patched version of pocketsphinx not installed")


i couldn't find the pocketsphinx.so file in the target dir - should it be renamed to libpocketsphinx.so.1?

trying to change the source code gave the following error:

[root /opt/voicy]# ./voicy.py
process 1753: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 1753: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
Aborted

Jannis 2013-08-20 21:30

Re: [DEVEL] Saera: Siri clone for Maemo5 and Harmattan
 
1 Attachment(s)
Quote:

Originally Posted by impeham (Post 1368262)
i couldn't find the pocketsphinx.so file in the target dir - should it be renamed to libpocketsphinx.so.1?

trying to change the source code gave the following error:

[root /opt/voicy]# ./voicy.py
process 1753: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 1753: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
Aborted


When pocketsphinx is installed, the file pocketsphinx.so should be in the directory /usr/lib/pyshared/python2.5
You can replace this file with the patched version.

Hmm, I have never experienced that dbus-error you described above. When exactly does this error message occur?
Perhaps try the following to see whether dbus generally works:
- Start the mediaplayer and let it play an mp3 file
- open an xterm
- start python
- enter the following two lines of code:
Code:

import subprocess as sb
sb.call('dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.pause', shell=True)

The mediaplayer should pause now.

If this worked, please enter the following python code:
Code:

import dbus
bus = dbus.SessionBus()
obj = bus.get_object("com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer", "/com/nokia/mafw/renderer/gstrenderer")
mafw = dbus.Interface(obj, "com.nokia.mafw.extension")
volume = int(mafw.get_extension_property("volume")[1])
print volume

It should print the current volume - level (something from 0 - 100)

See the attached file for easier copy&paste.


All times are GMT. The time now is 13:53.

vBulletin® Version 3.8.8