• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Analog Speaker and USB Mic combined for Voice control

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 2 Posters 2.7k Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    DevilRev
    last edited by Nov 9, 2016, 9:34 PM

    Hi guys, I have been trying to solve the following problem for 2 days now and I just can’t seem to find a solution.

    I’m trying create a voice control with voice output as reaction and therefore I need microphone and speakers. My speaker is analog and connected to the normal integrated soundcard (3.5mm jack) and for voice input a USB microphone.

    Only the audio device defined as card 0 will work, which means if I configure the speaker as card 0 i can hear voice output when i run the script manually but can’t talk to my raspi. When I set the USB microphone as card 0 I can’t hear anything and get an error because no audio devices can be found to output to but it recognizes my speech input.

    The software I’m using is hardly configurable. It is pyvona as a text to speech tool in a .py script and the MagicMirror module for voicecontrol using snowboy hotword detection: https://forum.magicmirror.builders/topic/425/voicecontrol-module

    Does anyone know a way of combing the 2 audio cards into one that has input and output respectively or has an idea how to configure either python to output to card 1 or the snowboy module on the MagicMirror to use card 1 as input?

    I already tried many of the solutions to combine 2 outputs in ALSA but I can’t seem to get it configured properly (I’m also quite new to this and am just throwing some things randomly together expecting other things to work)

    Thanks a lot in advance for any help!

    S 1 Reply Last reply Nov 9, 2016, 9:49 PM Reply Quote 0
    • S Offline
      strawberry 3.141 Project Sponsor Module Developer @DevilRev
      last edited by Nov 9, 2016, 9:49 PM

      @DevilRev as the PyAudio documentation says, that you can add input_device_index into the configuration https://people.csail.mit.edu/hubert/pyaudio/docs/#pyaudio.Stream.__init__

      I would give this a shot and add it to line 115 in voicecontrol/snowboy/snowboydecoder.py

      Please create a github issue if you need help, so I can keep track

      D 1 Reply Last reply Nov 10, 2016, 7:10 PM Reply Quote 0
      • D Offline
        DevilRev @strawberry 3.141
        last edited by DevilRev Nov 10, 2016, 7:11 PM Nov 10, 2016, 7:10 PM

        @strawberry-3.141
        Hi, at first thanks for taking the time and thanks for you help it sounds like a promising solution but I still don’t seem to get this working.

        I used p.get_device_info_by_index() to find out the index of my USB microphone, which is 2, and added input_device_index=2 to the snowboydecoder file BUT it still seems to somehow use the onboard audio card 0 and I have no idea why or what I did wrong.

        I uploaded the error shown when launching the magic mirror to pastebin maybe it can help you help me, I really want to solve this!
        http://pastebin.com/R1n3TmbP

        Also my snowboydecoder config file on pastebin: http://pastebin.com/U0yh4X1f
        maybe I added it at the wrong place but I was thinking this is the right place for it and didn’t know what to do with line 115.

        I really hope you can help me, thanks!

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        1 / 1
        • First post
          1/3
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Sam, technical setup by Karsten.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy