[의식의 흐름] 윈도우 10에서 구글 어시스턴트 써보기 #1


시작하며..

구글 어시스턴트를 라즈베리파이에서 블루투스로 써보려했건만 블투 마이크가 안된다는(크하하하하하하하...) 치명적인 스펙으로 USB 마이크가 도착할때까지 보류하기로 하기로 했습니다.
그런데 윈도우 10에서 하면 되잖아? 어차피 지금 윈도우10에서 블루투스 쓰고 있으니 그냥 하면 되겠네? 라는 생각이 들었습니다.
고고씽

준비


  1. 윈도10에 파이썬 설치
  2. 전 이미 쓰고 있는 LG HBS-810 블루투스 연결
아 준비가 너무 쉽다...
나는 왜 라즈베리로 이렇게 고생을 한건가...

구글링

대충 구글링해보니 이거 보고 하면 될듯

구글 Assistant API 등록


이미 전에 해놨으니 패스

인스톨 파이썬 프로젝트

명령어 프롬프트 열고 아래 명령 실행

py -m pip install google-assistant-sdk[samples]

은 실패!
아 진짜...

py -m pip install --upgrade setuptools

다시 시도 후 성공!

oath 를 빼먹으셨네...

py -m pip install --upgrade google-auth-oauthlib[tool]

google-oauthlib-tool --client-secrets client_secret_xxxx.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless

지난번과 마찬가지로 https로 시작하는 URL을 받아다 인증받고 키를 써주면 credentials 파일을 만들어줍니다.

자 이제 실행!


 googlesamples-assistant-pushtotalk  
 INFO:root:Connecting to embeddedassistant.googleapis.com  
 Press Enter to send a new request...  
 INFO:root:Recording audio request.  
 INFO:root:End of audio request detected  
 INFO:root:Transcript of user request: "hello".  
 INFO:root:Playing assistant response.  
 WARNING:root:SoundDeviceStream write underflow (size: 1600)  
 WARNING:root:SoundDeviceStream write underflow (size: 1600)  
 WARNING:root:SoundDeviceStream write underflow (size: 1600)  


역시나 마지막까지...ㅂㄷㅂㄷ
다시 구글링 해보니 이렇게 하라는군요.


 googlesamples-assistant-pushtotalk --audio-block-size=1024  
 INFO:root:Connecting to embeddedassistant.googleapis.com  
 Press Enter to send a new request...  
 INFO:root:Recording audio request.  
 INFO:root:End of audio request detected  
 INFO:root:Transcript of user request: "who are you".  
 INFO:root:Playing assistant response.  
 INFO:root:Finished playing assistant response.  
 Press Enter to send a new request...  

끝!


프로토타입 시험


자 이제 아들아 널 위한 장난감으로 구글 어시스턴트를 만들어본거란다!
마음껏 즐겨보렴!





1분만에 도망가버렸습니다 ㅠㅠ
재밌게 가지고 놀거라는 기대와는 다르게...크흡....
난 여태 뭐한거지...
아아....
현자타임 왔습니다..

댓글

  1. ㅋㅋㅋ재미있게 읽고 갑니다
    저도 설치좀하려는데 잘되려나요ㅠ

    답글삭제
  2. 인터넷에서 말하는 방법 다해봤는데 모두 실패ㅠㅠ

    답글삭제

댓글 쓰기

이 블로그의 인기 게시물

WSL2 Ubuntu 20.04 및 네트워크 설정

리눅스 멀티코어를 사용하는 tar 압축/해제

git pull 을 했더니 branch가 갈라지는 경우