user1321
user1321

Reputation: 71

OPUS Audio Format Safari Dilemma

In a few words: how use OPUS audio format in a Webapp (JSX PWA) and make it Safari compatible? Still highly compressed MP3s don't appear to yet be an alternative to OPUS.

Background info: Truly EVERYTHING was looked into - Media recorder API within Vanilla JS, Opus Media recorder. The last was using the React-Mic-basic component.

React-Mic worked on every browser except Safari. Here also tried WAV, Mp3, OGG and all don't work on Safari.

It appears the only solution here is playing around with encoding yet really clueless.

How could this be handled in 2021? A spec issue or perhaps impossible?

Best

Upvotes: 3

Views: 1072

Answers (1)

anthumchris
anthumchris

Reputation: 9090

Here's a proof-of-concept to get you started. Works in Safari via a WebAssembly Opus decoder. You'll need to dig into the code a little and handle buffer/backpressure control to avoid decoding everything into memory before it's played:

https://fetch-stream-audio.anthum.com/

Upvotes: 3

Related Questions