Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crushes soon after start #79

Open
pupadupa opened this issue May 28, 2024 · 1 comment
Open

Crushes soon after start #79

pupadupa opened this issue May 28, 2024 · 1 comment

Comments

@pupadupa
Copy link

Ubuntu 24.04, conda env with python 3.11.9,

Launching from terminal, it starts hearing me, but and after using it for few seconds it crushes (even if I'm using only English words while speaking):

$ whisper_mic  --loop --dictate --model=tiny
[05/28/24 23:54:51] INFO     No mic index provided, using default                                                                                                      whisper_mic.py:84
ALSA lib pcm_dsnoop.c:567:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dsnoop.c:567:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
[05/28/24 23:54:52] INFO     Mic setup complete                                                                                                                        whisper_mic.py:95
                    INFO     Listening...                                                                                                                             whisper_mic.py:213
ALSA lib pcm_dsnoop.c:567:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
 Can we hear? See you next time! Okay See you next time [] What? I haven't said it. [BLANK_AUDIO] routine What a strange his food. -maya Traceback (most recent call last):
  File "/home/pupadupa/anaconda3/envs/maya/lib/python3.11/site-packages/pynput/keyboard/_base.py", line 492, in type
    self.release(key)
  File "/home/pupadupa/anaconda3/envs/maya/lib/python3.11/site-packages/pynput/keyboard/_base.py", line 427, in release
    self._handle(resolved, False)
  File "/home/pupadupa/anaconda3/envs/maya/lib/python3.11/site-packages/pynput/keyboard/_xorg.py", line 235, in _handle
    raise self.InvalidKeyException(key)
pynput.keyboard._base.Controller.InvalidKeyException: '겸'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pupadupa/anaconda3/envs/maya/bin/whisper_mic", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/pupadupa/anaconda3/envs/maya/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pupadupa/anaconda3/envs/maya/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/pupadupa/anaconda3/envs/maya/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pupadupa/anaconda3/envs/maya/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pupadupa/anaconda3/envs/maya/lib/python3.11/site-packages/whisper_mic/cli.py", line 42, in main
    mic.listen_loop(dictate=dictate,phrase_time_limit=2)
  File "/home/pupadupa/anaconda3/envs/maya/lib/python3.11/site-packages/whisper_mic/whisper_mic.py", line 206, in listen_loop
    self.keyboard.type(result)
  File "/home/pupadupa/anaconda3/envs/maya/lib/python3.11/site-packages/pynput/keyboard/_base.py", line 495, in type
    raise self.InvalidCharacterException(i, character)
pynput.keyboard._base.Controller.InvalidCharacterException: (7, '겸')

@mallorbc
Copy link
Owner

mallorbc commented Jul 4, 2024

I guess it doesn't suppport chinese characters. Not sure if we just don't type these characters or add support somehow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants