AI generated
Oh, I thought I was the only one struggling to understand what QFN says sometimes. I often find myself just not reading most of its response and skipping straight to asking it, "just tell me in simple english what you are talking about". Like an example from a recent chat: Me: is this [16-bit output from audio.cpp] optimal from a compression standpoint? to minimize number of bits over the air? LLM: Question: Is 16-bit PCM WAV export optimal for minimizing over-the-air bits? Answer: WAV itself is not for over-the-air use, it's an intermediate format. What matters for over-the-air transmission is the final lossy codec. However, if you're going to encode to Opus afterwards, 16-bit PCM is a proper source format. Also regarding mono — narration is mono. Sample rate also matters — 48 kHz, or the model's native value? For over-the-air use, encode to Opus with DTX/CBR or VBR, and use mono. If literally transmitting in real time (streaming), use Opus live rather than WAV→Opus. Also mention that 16-bit vs 24-bit makes no difference at all after lossy compression. 16-bit is sufficient — actually even optimal, since lossy codecs like Opus are based on perceptual psychoacoustic modeling, and 16-bit quantization noise is below the masking threshold. Keep it concise. Two different stages — don't conflate them: 1. The WAV export (16-bit PCM) — an intermediate, not "over the air" - 16-bit PCM is ~1.4 Mbps (48 kHz mono). Nobody transmits that. It's just the mastering format before compression. - For that job 16-bit is optimal. 24-bit floats into a lossy encoder buys nothing — Opus/Vorbis are psychoacoustic; their quantization noise floor is far above 16-bit dither noise. 24-bit just makes the intermediate file 50% bigger. - One caveat: keep the WAV as high a sample rate as the model natively produced; resample at encode time, not before. 2. What actually goes over the air That's where the bit-minimizing happens, and 16-bit PCM is irrelevant there: model → 16-bit WAV (master) → ffmpeg → Opus mono → over the air Tuning for minimum bits: bash ffmpeg -i master.wav -c:a libopus -b:a 24k -ac 1 \ -application voip -frame_duration 40 -vbr on out.opus - -ac 1 mono — biggest free win, stereo narration doubles the bitrate - -frame_duration 40 — fewer packet headers, slightly better compression (60ms if latency doesn't matter) - -b:a 16-24k — audiobook speech floor before it sounds thin - For truly live streaming, run Opus live (not WAV→file) and enable DTX/CBR+FECC — silence suppression cuts ~50% on narration with pauses Bottom line Your chain is correct as-is: 16-bit PCM WAV = right mastering format; the bit-minimizing all happens at the Opus encode. ~24 kbps mono Opus ≈ 11 MB/hour, versus 16-bit WAV at ~330 MB/hour. Nothing beats that perceptually at speech. Me: i don't really understand. let's say i make a request to a audio.cpp server and it gives me some audio. is that audio going to be optimized for size over the air, or will it waste bits?