Currently, the library creates a MediaRecorder instance with browser defaults, which limits users ability to control specific recording parameters.
While this works in most cases, it may not work for all use cases, especially ones where a shared backend is used for app and web - for instance:
- iOS doesn't support for
webm within apps without using something like MediaVLCKit from VLC
- Some applications require specific formats for compatibility.
- Server-side conversion may be needed to convert from
webm to universally supported formats with something like ffmpeg which raises another bottleneck for low compute instances
Proposed Solution
Add support for configuring the MediaRecorder defaults:
useVoiceVisualizer({
mediaRecorderOptions: {
mimeType: 'audio/mp4', // or other supported types
// ... other MediaRecorder optiosn
bitsPerSecond: 128000,
}
})
This would give users the flexibility to choose their preferred mime type - if that mime type isn't supported by the browser (for instance firefox doesn't support audio/mp4 and Safari recently added support for audio/webm) the hook throws an error.
The current implementation would still be the default scenario if no options are provided.
Currently, the library creates a MediaRecorder instance with browser defaults, which limits users ability to control specific recording parameters.
While this works in most cases, it may not work for all use cases, especially ones where a shared backend is used for app and web - for instance:
webmwithin apps without using something like MediaVLCKit from VLCwebmto universally supported formats with something likeffmpegwhich raises another bottleneck for low compute instancesProposed Solution
Add support for configuring the MediaRecorder defaults:
This would give users the flexibility to choose their preferred mime type - if that mime type isn't supported by the browser (for instance firefox doesn't support
audio/mp4and Safari recently added support foraudio/webm) the hook throws an error.The current implementation would still be the default scenario if no options are provided.