Skip to content

Audio Encoding Opus

giongto35 edited this page Aug 31, 2019 · 1 revision

Introduction

Audio compression is also a critical part to reduce transferring size and improve streaming speed. Audio compression is even considered even harder than video compression because we are trying to formulize a smoothly continuous wave using concrete number.

Audio

Pulse-code modulation (PCM) is a method used to digitally represent sampled analog signals. CloudRetro fetches audio sample from emulator audio and compresses it.

Opus

Opus is lossy audio encoding format. We convert audio to Opus format using libopus library. Opus has a strict requirement on time frame. The number of sample needs to fit 1ms, 2.5ms ... to be able to encode

Audio Compression in CloudRetro

The challenge of audio streaming is that any of discontinuity is noticeable. We need a reasonable buffer for audio so that it can be in sync with Game emulator smoothly.