0

在树莓派我试图用gstreamer录制音频作为.flac或.wav文件。PyGST GStreamer损坏的谷歌语音api文件

我想要的音频文件被发送到inoffical谷歌语音API服务器

但我的GStreamer的管道输出为WAV

gst-launch-0.10 -e alsasrc device=hw:1 ! audioconvert ! audioresample ! audio/x-raw-int, depth=16, rate=16000, channels=1 ! wavenc ! filesink location= o.wav 

或作为后手

gst-launch-0.10 -e alsasrc device=hw:1 ! audioconvert ! audioresample ! audio/x-raw-int, depth=16, rate=16000, channels=1 ! flacenc ! filesink location= o.flac 

GET始终拒绝。

错误:(文件格式错误或错误的采样率)

{"status":5,"id":"11e0fa5e371b2f0a1a87def81f8383bc-1","hypotheses":[]} 

与SOX和编码与ffmpeg的或FLAC是工作,所以我想从GStreamer的输出文件通常记录不知何故损坏或IAM缺少的东西

编辑: 管道与-v http://hastebin.com/vovefeyewe.vbs运行alsasrc 后,但仍是同样的问题,增加了一个队列

解决

其他参数解决了这个问题

gst-launch-0.10 -e -v alsasrc device=hw:1 ! audioconvert ! audioresample ! "audio/x-raw-int, rate=(int)16000, channels=(int)1, endianness=(int)1234, width=(int)16, depth=(int)16, signed=(boolean)true, channles=(int)1" ! wavenc ! filesink location=g.wav 

而且如果有没有声音或只有随机噪声谷歌将拒绝与(错误格式错误)

回答

2

可以将文件您在您的管道中添加-v选项并发送输出?

+0

.wav管道与-v http://hastebin.com/vovefeyewe.vbs –

+0

尝试此管道,但我不知道这将工作。 gst-launch-0.10 -e -v alsasrc device = hw:1! audioconvert! audioresample! “audio/x-raw-int,rate =(int)16000,channels =(int)1,endianness =(int)1234,width =(int)16,depth =(int)16,signed =(boolean)true ,channles =(int)1“! wavenc! filesink location = g.wav – martien9

+0

仍然无法使用请参阅 - > http://hastebin.com/koqevaculu.vbs –