代码之家  ›  专栏  ›  技术社区  ›  Bhagwant

使用脚本而不是mic向google助手发送命令

  •  6
  • Bhagwant  · 技术社区  · 8 年前

    我已经在Raspberry Pi 3中配置了Google Assistant SDK,演示应用程序运行良好。是否有任何方法可以使用Python脚本将OK Google,Example命令发送到Google Assistant SDK?或者它只接受麦克风的输入?

    2 回复  |  直到 8 年前
        1
  •  4
  •   Derlin    8 年前

    更新

    现在可以使用 版本gRPC消息 AssistConfig 定义为一个联合体,您可以在其中选择 音频输出配置 或者 .


    蟒蛇 库,请参阅 AssistConfig pushtotalk.py sample, line 183 ):

    config = embedded_assistant_pb2.AssistConfig(
            # instead of audio_in_config
            # note: no need to use 'OK google'
            text_query = "who are you ?", 
            audio_out_config=embedded_assistant_pb2.AudioOutConfig(
                encoding='LINEAR16',
                sample_rate_hertz=self.conversation_stream.sample_rate,
                volume_percentage=self.conversation_stream.volume_percentage,
            ),
            dialog_state_in=dialog_state_in,
            device_config=embedded_assistant_pb2.DeviceConfig(
                device_id=self.device_id,
                device_model_id=self.device_model_id,
            )
        )
    

    如果您正在使用 , here is the link to the godoc .

        2
  •  0
  •   Prisoner    8 年前