本文整理汇总了Python中config.config.Config.get_answer_output_file方法的典型用法代码示例。如果您正苦于以下问题:Python Config.get_answer_output_file方法的具体用法?Python Config.get_answer_output_file怎么用?Python Config.get_answer_output_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config.config.Config
的用法示例。
在下文中一共展示了Config.get_answer_output_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Config
# 需要导入模块: from config.config import Config [as 别名]
# 或者: from config.config.Config import get_answer_output_file [as 别名]
from voice.voice_input_config import VoiceInputConfig
from voice.voice_input import VoiceInput
from voice.voice_output import VoiceOutput
from answer_api.wolfram_alpha import WolframAlpha
from config.config import Config
from audio.mp3 import Mp3
read_config = Config("../config/config")
voice_input = VoiceInput(read_config.get_speech_to_text_file())
voice_output = VoiceOutput(read_config.get_text_to_speech_file())
wolfram_alpha = WolframAlpha(read_config.get_wolfram_alpha_api_key(), read_config.get_answer_output_file())
mp3 = Mp3(read_config.get_text_to_speech_file())
speech_text = voice_input.get_speech()
wolfram_alpha.get(speech_text)
result_text = wolfram_alpha.parse()
if result_text is not None:
voice_output.write_speech(result_text)
mp3.play()
else:
print("No answer available")