weixin_39720510
eternal?
2021-01-01 19:56

How to avoid first ms chopped off the sound

Voice recording chops a few milliseconds at the beginning on the sound.

"Active something" is played back as "ctive something" in debug mode, obviously Bing doesn't understand.

utils/timeout.sh 10 rec -V1 -q -r 16000 -c 1 -b 16 -e signed-integer --endian little /tmp/jarvis-record.wav gain 0 silence 1 0.1 3 1 0.5 3 trim 0 5

该提问来源于开源项目:alexylem/jarvis

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

20条回答

  • weixin_39720510 eternal? 4月前

    Snowboy works much better indeed as a recorder

    点赞 评论 复制链接分享
  • weixin_39873208 weixin_39873208 4月前

    you are still with min noise perc to start at 2.1% Try to lower it manually to 0.1% but if after that the sound is still chopped off, stay with snowboy as recorder...

    点赞 评论 复制链接分享
  • weixin_39720510 eternal? 4月前

    Ok, I thought I didn't need to with the code change.

    It's better now, sound recording isn't chopped anymore but it's recording permanently as the room noise is above 0.1%

    点赞 评论 复制链接分享
  • weixin_39873208 weixin_39873208 4月前

    Ok then try to find the best value. New formula I use for auto-adjust levels in Settings > Audio should do it for you, but manual finetuning is better. Do you confirm you don't have the issue with snowboy recorder at all?

    点赞 评论 复制链接分享
  • weixin_39720510 eternal? 4月前

    Yep, Snowboy recorder doesn't have that problem. It's hard to make bing recognize anything if too far from the mic though but I guess that's another problem, I would need specific omnidirectional mic with noise cancellation, that's for another day :-)

    点赞 评论 复制链接分享
  • weixin_39720510 eternal? 4月前

    I would be great if sox had an option to include additional time (half a second) before the threshold is crossed

    点赞 评论 复制链接分享
  • weixin_39873208 weixin_39873208 4月前

    this is what I did, I added half a second before and after the recorded sound. Should be better now. And yes, for far end recognition, you need an array mic 😄

    点赞 评论 复制链接分享
  • weixin_39634900 weixin_39634900 4月前

    : Thanks you, it is not 100% ok but helps with the respeaker (without mic array for now)

    点赞 评论 复制链接分享
  • weixin_39720510 eternal? 4月前

    The MicArray module of the ReSpeaker alone would work with any generic device ? (My mac, a Raspberry pi 3, etc)

    点赞 评论 复制链接分享
  • weixin_39873208 weixin_39873208 4月前

    No idea, you'd better check out with the vendor.

    点赞 评论 复制链接分享
  • weixin_39634900 weixin_39634900 4月前

    Mine is seen as a USB microphone, so it should work but I never tested it yet. Someone tried it here, but we don't know if it is actually working.

    点赞 评论 复制链接分享
  • weixin_39873208 weixin_39873208 4月前

    this is because of sox audio levels. You min noice perc to start recording seems to be 3. Try to put it at 1% or less in Settings > Audio image

    点赞 评论 复制链接分享
  • weixin_39873208 weixin_39873208 4月前

    I think I found a way to improve this, testing now...

    点赞 评论 复制链接分享
  • weixin_39720510 eternal? 4月前

    I will do additional tests tonight : - Set noise level to 1% - Switch recorder to Snowboy - Whatever comes up with :-)

    I'm actually surprised, I thought the recorder what smart enough to maintain a buffer and include a few milliseconds before the level crosses the threshold to account for that.

    点赞 评论 复制链接分享
  • weixin_39873208 weixin_39873208 4月前

    It's my formula to calculate thresholds that is not correct, keep sox and try even: * min noice perc to start to 0.1%

    I'm adding a new parameter to keep the silence at the beginning, will definitely help bing. Give me an hour to finish my testing and push the update.

    点赞 评论 复制链接分享
  • weixin_39873208 weixin_39873208 4月前

    J'ai fait les changements sur la bêta: Pour le tester dès à présent: 1. Menu > Settings > General > Branch > beta 2. Menu > Search for updates 3. Relancer Jarvis 4. Refaire l'auto-adjust levels dans Menu > Settings > Audio > Auto-adjust levels Et dis moi si ca va mieux

    点赞 评论 复制链接分享
  • weixin_39720510 eternal? 4月前

    Same problem, unless I missed something

    
    ------------ Config ------------
    jv_branch            beta 
    jv_version           17.04.28 
    jv_arch              x86_64 
    jv_os_name           Mac OS X 
    jv_os_version        10.12.4 
    language             fr_FR 
    play_hw              false 
    rec_hw               false 
    speaker              Default 
    microphone           Default 
    recorder             sox 
    trigger_stt          snowboy 
    command_stt          bing 
    tts_engine           osx_say 
    --------------------------------
    
    
    DEBUG: start_listening hook
    utils/timeout.sh 10 rec -V1 -q -r 16000 -c 1 -b 16 -e signed-integer --endian little /tmp/jarvis-record.wav gain 0 silence 1 0.1 2.1% 1 0.5 2.1% pad 0.5 0.5 trim 0 5
    DEBUG: speech duration was 15 (10 = 1 sec)
    DEBUG: stop_listening hook
    
    点赞 评论 复制链接分享
  • weixin_39634900 weixin_39634900 4月前

    I did not had time to explore it for now but I have the same issue on the Respeaker, I was thinking it was the platform but if you have the same on macos...

    点赞 评论 复制链接分享
  • weixin_39873208 weixin_39873208 4月前

    This is related to sow audio levels, which is not always perfect even if you did the auto-adjust level well. just for the sake of experimentation, please change recorder to Snowboy in: Menu > Settings > Audio > Recorder > Snowboy And let me know if you face the same issue.

    点赞 评论 复制链接分享
  • weixin_39634900 weixin_39634900 4月前

    : Is there any other workaround than using Snowboy ? We cannot on the Respeaker

    点赞 评论 复制链接分享

相关推荐