TLSphinx icon indicating copy to clipboard operation
TLSphinx copied to clipboard

Audio buffer fix

Open mainvolume opened this issue 7 years ago • 6 comments

Audio buffer and format fix.

mainvolume avatar Jun 06 '18 20:06 mainvolume

Hey! @mainvolume Thank you very much for this PR :)

Could you please change the base? so your changes are merged in the development branch? I try to do it myself but it ends up adding some old commits not related to your changes.

Also, it will be great if you could explain a little why this is needed? It's kind of clear looking at the code but for those not so familiar with it a short explanation will be really helpful.

Could it be the case that these changes fix #44 ?

Thanks again!

BrunoBerisso avatar Jun 07 '18 08:06 BrunoBerisso

Surething!

mainvolume avatar Jun 07 '18 08:06 mainvolume

regarding #44

Could be as the model sample-rate has to be the same device for actual decoding 😄 when streaming. Have not tested with bluetooth device, but guessing that the audio settings from the device becomes easier when not set to a static frequency and adaptable to inputbus sample rate of the device.

This way, it becomes as well possible to use to the same decoder functionality with macOS as well.

mainvolume avatar Jun 07 '18 08:06 mainvolume

Hi Bruno.

I also added a decode buffer function for already obtained buffers and other streams of audio with added start and end utterance convenience functions.

🙂

mainvolume avatar Jun 07 '18 10:06 mainvolume

There, it should be tabbed cleaner now. 🙂

Also, a sample project using TLSphinx (without buffer) https://github.com/mainvolume/SpeechDetector

mainvolume avatar Jun 07 '18 11:06 mainvolume

🤔 regarding the endUtterence... the reason that it's public is to be able to end the utterance when there buffer is completed, or similar.

If you wish, we can make it private, but then the utterance would be running when the buffer ends considering the start call after reading the utterance.

🙂

mainvolume avatar Jun 07 '18 11:06 mainvolume