Unfortunately there does not appear to be a way to achieve this.
Mozilla's Configuring servers for Ogg media is very instructive. Basically:
- Gecko uses the
X-Content-Duration
header - sent by the web server if it has it. This explains the HTML5 audio streaming example you raised. If missing, then - Gecko estimates the length based on the sample-rate (in the header) and the size of the file from the
Content-length
HTTP header
The sample rate is stored in the Identification Header - the first header packet. See the specification go to section "4.2 Header decode and decode setup"