evancohen/smart-mirror

mic recognized error help...

JOJOYJ opened this issue · 16 comments

I installed it in order but the microphone is not recognized.

pi@raspberrypi:~/smart-mirror $ npm start

smart-mirror@0.0.25 start /home/pi/smart-mirror
electron main.js

Remote listening on http://192.168.XXX.XXX.:8080

pi@raspberrypi:~/smart-mirror $ npm run sonus

smart-mirror@0.0.25 sonus /home/pi/smart-mirror
node sonus.js

pi@raspberrypi:~/smart-mirror $

Your Environment

  • Environment name and version (e.g. Raspberry Pi 3, node.js 5.4): Raspberry pi 3 B+,
    node 8.16.2, npm 6.4.1
  • Operating System and version (e.g. Raspbian, Ubuntu, OSX): 2018 ?? ?? Stretch

so we have to do the debugging steps

  • open a command prompt
  • arecord -l
  • arecord test.wav
  • speak something
    
  • ctrl-c to stop arecord
  • aplay test.wav
  • do you hear what you said
    
  • did you configure the google speech api
  • did you download the file from google into the smart-mirror folder
  • is the name of the file 'keyfile.json' (it MUST BE unless u change the name in the config screen)
  • cd ~/smart-mirror
  • npm run sonus
  • say 'smart mirror'
  • you should see at the command prompt
  • !h: 1

then say 'smart mirror' pause then say 'show map'
and you should see

!h: 1
!p: show
!p: show me
!p: show map
!p: show
!p: show map
!f: show map
  • if speech is working
  • ctrl-c to end sonus
  • then npm start

I changed my google cloud speech-to-text api to keyfile.json.
The microphone test went well the microphone test went well, and the npm run sonus process did not respond.

while the npm run sonus is executing, in another window do

pgrep arecord

it should come back with a number (process id)
to indicate that arecord is running, listening for speech

what language do you speak? the umdl file is sensitive to certain dialects

you must say the english words smart mirror (no punctuation)

if the UI is running, a gray bar will appear on the bottom of the screen to indicate dialog has started

you can change the language via the config panel, but until you do config and save it, the system is american english

then the actual command 'show map' (for example)

the supported languages are listed in smart-mirror/app/locales

I'm using Korean, but I turned the translate around and called it a smart mirror.
Start the npm start and "what I can say" in the UI below. Go to http://xxx.xxx.xxx.xxx.8080 and control it only with my phone, and only YouTube carries out the order. The error code does not appear at startup, but does not become a microphone.

Yes, mic doesn't work in config screen

See the ko.json file in app/locales

Another Korean user said he had to change something

Thank you for your kind reply.
Change config.default.json in smart-mirror/remote to config.json and move to smart-mirror.
I put the key api in.
Still, the problem with the microphone is not solved.
This is my config json. Is this the right way to do it? If not, can you tell me how to do it?

{
  "general": {
    "language": "ko-KR",
    "layout": "main",
    "commandsPerPage":10
  },
  "remote": {
    "enabled": true,
    "firstRun": true,
    "port": 8080
  },
  "autoTimer": {
    "mode": "disabled",
    "autoSleep": 40,
    "autoWake": "07:00:00",
    "wakeCmd": "sudo ./scripts/raspi-monitor.sh on > /dev/null 2>&1",
    "sleepCmd": "sudo ./scripts/raspi-monitor.sh off > /dev/null 2>&1"
  },
  "motion": {
    "enabled": false,
    "pin": "GPIO26"
  },
  "speech": {
    "device": "default",
    "keyFilename": "./keyfile.json",
    "hotwords": [
      {
        "keyword": "smart mirror",
        "model": "smart_mirror.umdl"
      }
    ],
    "sensitivity": "0.5"
  },
  "forecast": {
    "key": "",
    "units": "auto",
    "refreshInterval": 2
  },
  "light": {
    "settings": {
      "hueIp": "",
      "hueUsername": ""
    },
    "setup": []
  },
  "calendar": {
    "icals": [
      ""
    ],
    "maxResults": 9,
    "maxDays": 9,
    "showCalendarNames": true
  },
  "giphy": {
    "key": "dc6zaTOxFJmzC"
  },
  "youtube": {
    "key": ""
  },
  "soundcloud": {
    "key": ""
  },
  "spotify": {
    "key": ""
  },
  "traffic": {
    "key": "",
    "refreshInterval": 5,
    "trips": []
  },
  "rss": {
    "feeds": [],
    "refreshInterval": 120
  },
  "stock": {
    "names": []
  },
  "lastfm": {
    "key": "",
    "user": "",
    "refreshInterval": 0.6
  },
  "todoist": {
    "key": ""
  },
  "fitbit": {
    "timeout": 10000,
    "uris": {
      "authorizationUri": "https://www.fitbit.com",
      "authorizationPath": "/oauth2/authorize",
      "tokenUri": "https://api.fitbit.com",
      "tokenPath": "/oauth2/token"
    },
    "authorization_uri": {
      "redirect_uri": "http://localhost:4000/fitbit_auth_callback/",
      "response_type": "code",
      "scope": "activity nutrition profile settings sleep social weight heartrate",
      "state": "3(#0/!~"
    }
  }
}

I saw the Ko.json file. I can't do a smart mirror now. I'll record it today and try again.
I can't understand the last sentence."You are receiving this because you commented.
Reply to this email directly, view it on GitHub"
Are you saying you're being questioned by e-mail?

that is just the email tell you how to look at my response.. or to respond via email and the email will update the issue on github

I can't recognize the microphone.
I changed everything but I can't. microphone. Recording, ko.json,
I'm stupid and trying. :( I don't think it's a language problem. I'm thinking of a problem with Sonus but I don't know. "npm start" and I don't have an error code. be too stuffy

"npm run sonus" cursor not flashing
pi@raspberrypi:~/smart-mirror $ npm run sonus

smart-mirror@0.0.25 sonus /home/pi/smart-mirror
node sonus.js

we need to get npm run sonus to work first before starting the mirror app..

so, as I said before, open another shell and do

ps -ef | grep arecord

to see if arecord is running when

npm run sonus 

is running..

and we will only say 'smart mirror' (no punctuation)

npm run sonus
> smart-mirror@0.0.25 sonus /home/sam/smart-mirror.save-new
> node sonus.js
(cursor blinking)
spoke words =>smart mirror
!h: 1   --- heard smart mirror
!f:       --- no other words detected, command request completed

After this is what happens.
pi@raspberrypi:~/smart-mirror $ ps -ef | grep arecord
pi 30792 30778 0 17:01 pts/0 00:00:00 grep --color=auto arecord

Npm run sonus doesn't respond. Should I reinstall it from scratch?
Has anyone recently installed it and implemented it? If so, is there a recommended OS version and detailed version of the reinstallation?

the ps -ef should show two processes

ps -ef | grep arecord
odroid   22613 22549  0 Nov04 pts/0    00:04:33 arecord -D default -q -r 16000 -c 1 -t wav -f S16_LE -
odroid   31300  3414  0 06:28 pts/0    00:00:00 grep --color=auto arecord

arecord is not running...

can u do

arecord --version

here is my output
arecord: version 1.1.3 by Jaroslav Kysela perex@perex.cz

earlier you said

The microphone test went well the microphone test went well,

did you do

arecord test.wav

say something
ctrl-c on keyboard

aplay test.wav

did u hear what you said?

OMG....... Thank you so much. Thanks to your help, I've been successful in voice recognition.
You're gonna be so lucky.

What was the problem?

I think there was an error in the sonus part. So when I installed it again, it succeeded. It was too simple...