GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Streaming data either too fast or too slow · Issue #927 · GoogleCloudPlatform/java-docs-samples Closed DescriptionDescriptionI try to send mic data to from browser across my server then to google for recognition, here is the core code for data sending to google cloud api. const context = new AudioContext(); ....//audioPromise --> micStream --> context.createMediaStreamSource(micStream) const scriptNode = context.createScriptProcessor(4096, 1, 1); // context is AudioContext with 48000 sample rate scriptNode.addEventListener('audioprocess', function(e) { const floatSamples = e.inputBuffer.getChannelData(0); const data = btoa(floatSamples); stompClient.send('/wss/speech/transcribe', {}, data); }); Here is server-side data logic sending data to google: StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder() .setAudioContent(ByteString.copyFrom(java.util.Base64.getDecoder().decode(data))) .build(); // Thread.sleep(2550); // without this line, i got too fast; with thread.sleep an other numbers yeild either too slow or too fast, what is optimial? requestObserver.onNext(request); Issues
Could you help me is there anything I did wrong? How can I solve these issue? Activity
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |