如何在qt4上运行语音识别终端代码

时间:2014-02-26 10:05:21

标签: c++ qt

我在树莓派的帮助下完成了语音识别。在最初,我已经在终端上运行我的代码,我的硬件是覆盆子pi,但现在我想在qt creator上使用相同的硬件运行该代码,那么应该是什么代码? 我的代码链接在终端和raspberry pi上成功运行。

echo "Recording your Speech (Ctrl+C to Transcribe)"
arecord -D plughw:0,0 -q -f cd -t wav -d 0 -r 16000 | flac - -f --best --sample-rate 16000 -s -o daveconroy.flac;

echo "Converting Speech to Text..."
wget -q -U "Mozilla/5.0" --post-file daveconroy.flac --header "Content-Type: audio/x-flac; rate=16000" -O - "http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium" | cut -d\" -f12  > stt.txt

echo "You Said:"
value=`cat stt.txt`
echo "$value"

请帮我找出解决方案。

1 个答案:

答案 0 :(得分:0)

嗯,理想情况下它非常简单,

  1. 创建新的qt项目
  2. 将您的资源/资源添加到新项目
  3. 设置构建规则
  4. 构建您的应用程序和wuala,享受!
  5. 将现有c++项目集成到qtcreator应该不是什么大问题,因为Qt是基于c++的框架。

    我建议您查看qtcreator here

    的手册/帮助