[vorbis-dev] Seeking ogg-vorbis
Michael Smith
msmith at xiph.org
Tue Jul 22 17:59:53 PDT 2003
> I have seen the examples, but they are somewhat "simplistic" (no mean to
> offense anybody!). I need to solve the following scheme:
> - The files I'm playing represent up to 24 hours of continuous
> recording.
> - I need to decode the stream to a PCM memory buffer, that will be used
> later by existing components to do the actual playing (this allows me to
> display fancy graphics and so on).
> - I need to be able to seek to any position (seconds) in the file, and
> it needs to be quick, and, most of all, needs to use low resources (I mean,
> I can't decode the entire day into memory, for obvious reasons)
> - The files are recorded using the same parameters for all the file. I
> mean, each file can have it's own sample rate, number of channels, and so
> on, but it will be constant for any given file.
> - I just need to play one file at the time.
That's all very easy to do using libvorbisfile. The documentation is pretty
easy to follow for this sort of thing. The only potential problem is that you
say that seeking needs to be 'quick'. Vorbis seeking isn't particularly fast,
generally. However, this depends very much on what you consider 'quick', and
what sort of hardware you're doing this on. You may have problems if you need
seek latency under 10 ms (but experiment, it's obviously highly dependent on
your cpu, etc.)
So, this basically consists of ov_open() (or ov_open_callbacks() if you have a
non-file source for your data) to open the file, ov_clear() to close it once
you're done, and calls to ov_read() to decode into a PCM memory buffer, and
to one of the ov_seek_*() calls for seeking (probably ov_seek_time()). If you
have more specific questions, feel free to ask - but vorbisfile is very easy
to use, you shouldn't have too much trouble.
>
> BTW: I'm using Borland C++Builder 6 to do this job, under Windows. I had
> some trouble using the libs provided with the SDK, and I had to do an
> implib from the DLLs. This is fine. The problem is: The libs are generated
> using a calling convention that I don't use (and I can't use, because I
> have another DLLs using different calling convention). Any idea of how to
> solve it? Is it possible to recompile the SDK using Borland's tools? I'm
> sorry if this is a "stupid" question, as I'm remembering now that I didn't
> checked the implib help to see if it is something that can be changed here.
>
You can recompile the SDK if you want. You should also be able to tell your
compiler than you want to use the normal calling convention for the vorbis
libraries (while still using your non-standard calling convention for
everything else) - all of the win32 compilers I've seen have a mechanism for
doing this, but I don't know much about BCB, so I can't give specifics.
<p>Mike
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis-dev
mailing list