How can I stream an audio recording realtime in ionic to Firebase?

Viewed 1017

I'm trying to implement realtime speech to text recognition with Google API service using Ionic as a frontend. I am not able to find a library that can record from Ionic and stream the recording in realtime to be stored in the google bucket storage. Do you have any suggestions?

2 Answers

I don't think you need to use any special library/plugin to do this, you can simply use Web Technologies to achieve this by using MediaDevices API to getUserMedia for getting Audio stream from device microphone and using Web Speech API for speech recognition, and use WebSocket to transmit real-time audio stream to Google Speech-to-Text API and receive real-time response back.

For further reading, check the following resources:

Delivering a Smooth Cross-Browser Speech to Text Experience

Speaking with a Webpage - Streaming speech transcripts

Assuming that you want to use the React Native framework. You can checkout Media plugin from the Ionic framework that can be used to record the audio files. Here is an example(which is developed using angular, but you can understand the underlying concept). Also for using Firebase to stream in real-time, check out the firebase plugin.

There are Streaming media plugin, which can also be used in your case. For more reference, I would suggest using the official documentation and look into this blog post

Related