STBLESensor_Android icon indicating copy to clipboard operation
STBLESensor_Android copied to clipboard

Speech to text encoding

Open mmrobert opened this issue 6 years ago • 2 comments

Hi, it is me again.

Hi, there, I am working in NeuronicWorks, Toronto, as a mobile developer.

Now I am using your development kit for your blue tooth (chip) device.

private final Feature.FeatureListener mAudioListener = (f, sample) -> { short[] audioSample = FeatureAudioADPCM.getAudio(sample); };

In above method, the "audioSample" is Linear PCM encoded data (also decompressed), is it right?

As I need to use Google stream speech API, so how do I transform this short[] format to byte[]?

Best regards,

Boqian

mmrobert avatar Dec 10 '18 22:12 mmrobert

Hi Boqian,

yes it the LinearPCM decopressed byte stream. to convert short to bytes you can use this class: https://github.com/STMicroelectronics-CentralLabs/STBlueMS_Android/blob/398575b3d5572cb3b7b435db5b2be6e522754037/BlueMS/src/main/java/com/st/BlueMS/demos/Audio/SpeechToText/util/BytesConverterUtil.java#L46

or something like the AudioBuffer class: https://github.com/STMicroelectronics-CentralLabs/STBlueMS_Android/blob/398575b3d5572cb3b7b435db5b2be6e522754037/BlueMS/src/main/java/com/st/BlueMS/demos/Audio/Utils/AudioBuffer.java#L91

Best regards, Giovanni

GiovanniVisentiniST avatar Dec 11 '18 07:12 GiovanniVisentiniST

Hi, I am using fp-sns-allmems2 libraby for sensiBLE device but it could not turn on the bluetooth after flashing the same code with bootloader. And no issue was there while loading fp-sns-allmems1 libraby. So if anyone has faced the same problem please help me.

Best Regards, Ekta

EktaRathod avatar Aug 10 '19 12:08 EktaRathod