What you see: VLC shows "Opening media... Ogg Stream Init Download" in the status bar, or Audacity attempts to import an Ogg stream and fails.
Why: Some online radio streams or networked media systems send the Ogg initialization headers separately from the data. If your player expects the headers and data in a single file but receives them out-of-order or incomplete, it interprets this as a "download" action—saving the incomplete initiation data to a temporary file.
If you want to save an internet radio stream (often a .ogg or .opus URL) to your hard drive: Ogg Stream Init Download
Method A: VLC Media Player (GUI)
Method B: Command Line (FFmpeg) This is the most robust method for downloading streams. What you see: VLC shows "Opening media
# Basic download
ffmpeg -i http://example.com/stream.ogg -c copy output.ogg
When a browser or media player encounters an Ogg file, it has to decode the container, find the audio/video streams, and begin playback.
The Web Audio API (AudioContext.decodeAudioData) is powerful but high-level. If you pass it the partial buffer from Step 1, it might fail because it expects a complete file or valid boundaries. Method B: Command Line (FFmpeg) This is the
For strict "Stream Init" handling, you often need a specialized library (like opus-decoder or ogg.js) because native AudioContext does not expose the raw header data easily.
However, for standard playback, you can try to decode the initial segment:
async function playStream(url) window.webkitAudioContext)();
// Get the initial chunk
const buffer, reader = await initOggStream(url);
try
// Attempt to decode the initial chunk.
// Note: Native decoders often fail on partial chunks.
// This works best if the server serves a distinct file header.
const audioBuffer = await audioCtx.decodeAudioData(buffer);
// If successful, the "Init" is done. You now have sampleRate and channels.
console.log("Stream Initialized!");
console.log("Sample Rate:", audioBuffer.sampleRate);
console.log("Channels:", audioBuffer.numberOfChannels);
// Play the initial chunk
const source = audioCtx.createBufferSource();
source.buffer = audioBuffer;
source.connect(audioCtx.destination);
source.start();
catch (e)
console.error("Native decoder failed on partial stream. Use a library like opus-stream-decoder.", e);