#!/usr/bin/env python # -*- coding: utf-8 -*- import requests import json import os import commands import time import RPi.GPIO as GPIO GOOGLE_APIKEY = 'APIキー入力' LISTEN_SECONDS = 3 #3秒 録音 VOICE_IN_PATH = '/home/pi/tmp.flac' #GPIO設定 GPIO.setmode(GPIO.BCM) GPIO.setup(2, GPIO.OUT) GPIO.setup(3, GPIO.OUT) GPIO.setup(4, GPIO.OUT) GPIO.output(2, 0) GPIO.output(3, 0) GPIO.output(4, 0) # 音声入力 (音声→音声データ) d