Skip to content

Instantly share code, notes, and snippets.

@tsu-nera
Created August 25, 2018 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsu-nera/4ee31fe433face81a6f0a6d42332ba31 to your computer and use it in GitHub Desktop.
Save tsu-nera/4ee31fe433face81a6f0a6d42332ba31 to your computer and use it in GitHub Desktop.
音声入力 スクリプト
File Edit Options Buffers Tools Python Help
#!/home/tsu-nera/anaconda3/bin/python
import speech_recognition as sr
import pyperclip
import pyautogui
r = sr.Recognizer()
mic = sr.Microphone()
with mic as source:
r.adjust_for_ambient_noise(source)
audio = r.listen(source)
pyperclip.copy(r.recognize_google(audio, language='ja-JP'))
pyautogui.hotkey('ctrl', 'V')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment