SOPARE 1.5 is available; Feedback

Just a quick head up: SOPARE 1.5 is released and of course this version is the best version that is currently available 😉

Raspberry Pi offline speech recognition voice control

SOPARE stands for SOund PAttern REecognition and it is a Python program that provides offline and real time voice recognition on a Raspberry Pi or alike. The source code is available. Read more.

Many things have changed since the last video tutorials were made.

Commits to GitHub since last tutorial

You will notice that the configuration file changed and moved to another location. In addition, the text “start endless recording” does not appear as promised. If you want the text to appear you can change the log level to “INFO”.

The plan is to create a new, updated tutorial with lots of interesting stuff inside. There is already some feedback available from the former tutorials (e.g. make the console text bigger or better readable, start from scratch video, …) and I’ll do my best to consider that.

Feedback

However, if you have ideas or special requests please do not hesitate and write a comment to let me know.

Happy voice controlling and have fun!

22 thoughts on “SOPARE 1.5 is available; Feedback

    • Hey. In my opinion the first steps and even a bit further is covered in the available posts and videos. However, some people are asking for some more detailed steps in terms of installation…this topic is on the list for the next upcoming tutorial.

  1. Maybe a section on how to add our own plugin. can we add folders in plugin folders, do we need to add code to register…
    It will be better than just modifying always plugin/print

    Thanks a lot for your work by the way.

    • You are welcome 🙂

      Ok, the next tutorial is about custom plugins. Maybe I get something done within the next two week, but I can’t make any promises…

  2. Thank a lot for sharing sopare.

    i am a student, my project is home automation through voice recognition. i have successfully installed SOPARE in raspberry pi 3.
    let me guide how can config commands like light on, light off etc. i am using usb microphone. i am humbly request to u please guide me for further action.

    i am waiting for your positive response..

  3. hi martin
    you are doing great work brother
    i m student i want to train SOPARE in my local language can you please guide how can i send commands in urdu then sopare translate or how can config commands like light on, light off etc. i am using usb microphone. i am humbly request to u please guide me for further action.

    • Hi. You can train SOPARE in your native language and you can set the ID as you want. Just make sure that the character encoding works in the command line. As I’ve never developed using India encoding here is my advice: Start by using ASC IDs (English words like light, on, off) and train SOPARE by speaking your native Urdu language to avoid encoding errors and issues and to get first results.

  4. Thank you for this project! Is there a way to handle empty results like [] so that sopare will restart.

    Example: sudo ./sopare.py
    results returned [] so restart sopare: sudo ./sopare.py?

    The reason being is I want to be able to transition from the custom plugin, which calls some complex handling or even plays a song, then restart sopare to listen. When I use: Sudo ./sopare.py -l eventually it will hang up and I have to CTRL-C

    • You are welcome. Instead of restarting you should fix the hang up problem. If you have a custom plugin with complex handling you need to decouple it from the thread that calls it. Think about a fast, small and lightweight plugin that calls (or initiates or communicates with) the complex thread (or external process).

    • Hi. In this very moment I’m busy doing other things and having different priorities. So the answer is like often not a clear yes or no. But as there are open issues and my TODO list I can say that it’s not done and you should expect activity in the future 😉

  5. Hi Martin

    schön – endlich mal einen Entwickler in Deutschland gefunden.
    Das Ganze sieht schon mal sehr gut aus. Ich habe es auf einem
    OrangePi Zero zum Laufen gebracht. Es funktioniert erstaunlich gut.
    Habe nur das im OrangePi verbaute Micro.
    Erst kam eine Fehlermeldung bei Audiotest, weil du 4 CPU Kerne vorraussetzt.

    Ich habe dann einfach in der
    /test/test_audio.py in der Zeile 73 die “4” gegen einen “1” getauscht

    def test_environment(self):
    self.assertGreaterEqual(multiprocessing.cpu_count(), 1, ‘SOPARE requires a multiprocessor architecture and

    Der OrangePi besitzt auch 4 Kerne.
    Vielleicht hilft es ja jemand.

    Mal eine ganze andere Sache.
    Ich denke du steckst da tiefer in der Materie und kannst mir Hinweise geben in welche Richtung ich schauen muss.
    Ich möchte deine Spracherkennung auf einer zentralen Einheit laufen lassen z.b. einem Pi4. In mehreren Zimmern
    sind kleine OrangePis oder ESP32 “Mikrofone” die Ihre Aufnahmen an die Zentrale senden.
    Siehst du einen Weg das zu realisieren und wenn ja welche Software und wie.
    Ich brauche keine kompletten Tutorial nur ein paar Hinweise.
    Danke

    Grüße
    Jürgen

    • Hi. Ich wolle mit der Kern-Abfrage eigentlich nur verhindern das “ältere” Raspberry Pis genutzt werden um die Support Last für mich zu minimieren…die 4 Kerne wurden von mir gewählt um den Pi Zero auszuschließen, der für die SOPARE Architektur nur bedingt geeignet ist. JFYI.

      Für das von dir gewünschte Unterfangen kann ich nur auf PulseAudio/Alsa verweisen. Damit sollte es möglich sein Sound aus dem Netzwerk auf einem Device weiter zu verarbeiten. Allerdings bin ich in bei dem Thema kein Experte und verweise auf das Wissen im Internet.

  6. Hi Martin,
    i have tried to install sopare under raspbian stretch and buster, but i failed.
    If i invoke “python test/test_audio.py” i receive a bunch of error messages like :

    test_audio init…
    Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
    Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.front.0:CARD=0’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM front
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround40.0:CARD=0’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround40
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround41
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround50
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround51
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround71.0:CARD=0’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround71
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM iec958
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM spdif
    ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    …………………

    HW tests of speaker (via raspberry output jack) and usb microphone using aecord and aplay work fine.
    Any ideas where to start the search for the reasons of the error messages above ?

    Kind Regards
    Martin

    • These are just ALSA lib warnings and info messages and as far as I can see no error…however, I would suggest to clean you ALSA config 😉

  7. Hi Martin,
    thank you very much for this super project. I am using it to control my small robot-car with speech. To keep the plugin as simple as possible, I use MQTT to send the commands to the robot-car software (within the same Raspberry Pi), this is working great.
    Now I would like to my iPhone to control the robot (same concept but: Sopare and MQTT publication service in iPhone and MQTT subscription in Raspberry Pi).
    Q: is there any Xcode Podfile available somewhere or do see it possible to adapt the code in Swift?
    Thank you very much for your ideas!
    Very kind regards
    Kurt

    • Thanks, glad that you like the project. There is no Xcode file as I develop directly on the Pi and use Python as described 😉

      Have fun!

Schreibe einen Kommentar zu Jürgen Antworten abbrechen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert