Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 uid=99(nobody) gid=98(nobody) groups=98(nobody) Safe-mode: OFF (not secure) /usr/doc/libvorbis-1.0/vorbisfile/ drwxr-xr-x | |
| Viewing file: Select action/file-type:
Chaining Example CodeThe following is a run-through of the chaining example program supplied with vorbisfile - chaining_example.c. This program demonstrates how to work with a chained bitstream.
First, relevant headers, including vorbis-specific "codec.h" and "vorbisfile.h" have to be included.
Inside main(), we declare our primary OggVorbis_File structure. We also declare a other helpful variables to track our progress within the file.
ov_open() must be
called to initialize the OggVorbis_File structure with default values.
ov_open() also checks to ensure that we're reading Vorbis format and not something else.
First we check to make sure the stream is seekable using ov_seekable. Then we're going to find the number of logical bitstreams in the physical bitstream using ov_streams. We use ov_time_total to determine the total length of the physical bitstream. We specify that we want the entire bitstream by using the argument -1.
Now we're going to iterate through each logical bitstream and print information about that bitstream. We use ov_info to pull out the vorbis_info struct for each logical bitstream. This struct contains bitstream-specific info. ov_serialnumber retrieves the unique serial number for the logical bistream. ov_raw_total gives the total compressed bytes for the logical bitstream, and ov_time_total gives the total time in the logical bitstream.
When we're done with the entire physical bitstream, we need to call ov_clear() to release the bitstream.
The full source for chaining_example.c can be found with the vorbis
distribution in chaining_example.c.
|
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0308 ]-- |