Omi allows you to stream audio bytes from your DevKit1 or DevKit2 directly to your backend or any other service, enabling you to perform various analyses and store the data. You can also define how frequently you want to receive the audio bytes.
Create an endpoint (webhook) that can receive and process the data sent by our backend. Our backend will make a POST request to your webhook with sample_rate and uid as query parameters. The request from our backend will look like this:
POST /your-endpoint?sample_rate=16000&uid=user123
The data sent is of type octet-stream, which is essentially a stream of bytes. You can either create your own endpoint or use the example provided below. Once itโs ready and deployed, proceed to the next step.
Note: The sample rate refers to the audio samples captured per second. DevKit1 (v1.0.4 and above) and DevKit2 record audio at a sample rate of 16,000 Hz, while DevKit1 with v1.0.2 records at a sample rate of 8,000 Hz. The uid represents the unique ID assigned to the user in our system.
Thatโs it! You should now see audio bytes arriving at your webhook. The audio bytes are raw, but you can save them as audio files by adding a WAV header to the accumulated bytes.
Check out the example below to see how you can save the audio bytes as audio files in Google Cloud Storage using the audio streaming feature.
GOOGLE_APPLICATION_CREDENTIALS_JSON
: Your GCP credentials, encoded in base64.GCS_BUCKET_NAME
: The name of your GCP storage bucket./audio
.Every x seconds
field.We welcome contributions from the open source community! Whether itโs improving documentation, adding new features, or reporting bugs, your input is valuable. Check out our Contribution Guide for more information.
If youโre stuck, have questions, or just want to chat about Omi:
Happy coding! ๐ป If you have any questions or need further assistance, donโt hesitate to reach out to our community.