napatswift / CB-webapp

0 stars 0 forks source link

Web application #1

Open napatswift opened 8 months ago

napatswift commented 8 months ago

Build a simple application that can send audio data to the server.

Acceptance criteria

napatswift commented 8 months ago

Reading: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API

The Web Audio API focuses on audio processing and playback, not recording. However I found that I maybe can use the AnalyserNode to get the current audio data using .getByteTimeDomainData.

AnalyserNode

The AnalyserNode allows time-domain analysis of audio passing through it. By calling getFloatTimeDomainData() or getByteTimeDomainData(), you can get the current waveform/time-domain data of the audio. So, from my understanding, I can use this object to send audio data to the server. One important detail is that AnalyserNode always downmixes the input to a mono signal before analysis. So the audio data will be merged to a single channel before you access it.

napatswift commented 8 months ago

https://github.dev/gradio-app/gradio