Created
August 25, 2018 16:08
-
-
Save tsu-nera/4ee31fe433face81a6f0a6d42332ba31 to your computer and use it in GitHub Desktop.
音声入力 スクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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