Recently, I've been dabbling in creating a new app using Cordova, VueJs, and Onsen UI for VueJs. One of the main features I want to implement is the ability to use the microphone on Android or iOS devices to record audio and then send it to the Google Speech to Text API.
While I have an idea of how to send the data to the API, my challenge lies in figuring out how to actually record the data from a mobile device and utilize it temporarily without saving it directly to the device (unless there's no network connection, in which case it should be saved for later submission when connectivity is restored).
There are several key functionalities I need to incorporate: - Selectable bitrate - Monitoring available storage space on the device to estimate maximum recording duration - Extended recording time based on available space (with the option to split recordings if necessary) - Customizable UI implementation
I've researched various methods to achieve this, but most resources I found are outdated, use deprecated functions, or come with pre-set UI designs.
I've experimented with several recommended Cordova plugins, yet the only one that worked came with a fixed UI, which doesn't align with the custom UI requirement for my project. I also attempted to use getUserMedia()
directly on my iPhone via Safari developer tools, but it returned undefined results.
If you know of any cutting-edge native functionalities, useful npm packages, or Cordova plugins that could help me achieve my goal, please share your suggestions or links!
Edit: In summary, I'm seeking the most effective method (applicable to both platforms) to record audio, store it temporarily if necessary, and manipulate it for tasks like sending it to APIs.
Edit 2: The client has introduced some new requirements, significantly expanding the scope of the app. One crucial request is now to save the user-recorded audio files for playback at any time without syncing between devices. Although the focus has shifted slightly, I still need to address the primary question while incorporating the feature to save recorded audio.