evancohen / smart-mirror

The fairest of them all. A DIY voice controlled smart mirror with IoT integration.
http://smart-mirror.io
2.8k stars 694 forks source link

mic recognized error help... #810

Closed JOJOYJ closed 4 years ago

JOJOYJ commented 4 years ago

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

sdetweil commented 4 years ago

so we have to do the debugging steps

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
JOJOYJ commented 4 years ago

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.

sdetweil commented 4 years ago

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

JOJOYJ commented 4 years ago

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.

sdetweil commented 4 years ago

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

JOJOYJ commented 4 years ago

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/!~"
    }
  }
}
sdetweil commented 4 years ago

You connect to your smart-mirror at ip:port from another system to bring up the config app then hit the gear on the top bar. Make changes and hit submit

I think you should try recording your own language model file.

Did u look at the locale file? ko.json?

And u must start each command with the hotword phrase, two words, 'smart mirror'

On Sun, Nov 3, 2019, 9:04 PM JOJOYJ notifications@github.com wrote:

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/!~" } } }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/evancohen/smart-mirror/issues/810?email_source=notifications&email_token=AALNYHSEPWSRY5MAIK5BH4DQR6GNJA5CNFSM4JIKPR6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC6FBQY#issuecomment-549212355, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALNYHQH4PJYARICQCV2V6LQR6GNJANCNFSM4JIKPR6A .

JOJOYJ commented 4 years ago

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?

sdetweil commented 4 years ago

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

JOJOYJ commented 4 years ago

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

sdetweil commented 4 years ago

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
JOJOYJ commented 4 years ago

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?

sdetweil commented 4 years ago

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?

JOJOYJ commented 4 years ago

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

sdetweil commented 4 years ago

What was the problem?

JOJOYJ commented 4 years ago

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