Import with #import "std/vorbis_linux".
OggSyncState :: struct { data: *u8; storage: s32; fill: s32; returned: s32; unsynced: s32; headerbytes: s32; bodybytes: s32; }ogg_sync_state.
OggStreamState :: struct { body_data: *u8; body_storage: isize; body_fill: isize; body_returned: isize; lacing_vals: *s32; granule_vals: *s64; lacing_storage: isize; lacing_fill: isize; lacing_packet: isize; lacing_returned: isize; header: [282]u8; header_fill: s32; e_o_s: s32; b_o_s: s32; serialno: isize; pageno: isize; packetno: s64; granulepos: s64; }ogg_stream_state.
OggPackBuffer :: struct { endbyte: isize; endbit: s32; buffer: *u8; ptr: *u8; storage: isize; }oggpack_buffer.
VorbisInfo :: struct { version: s32; channels: s32; rate: isize; bitrate_upper: isize; bitrate_nominal: isize; bitrate_lower: isize; bitrate_window: isize; codec_setup: *void; }vorbis_info.
VorbisDspState :: struct { analysisp: s32; vi: *VorbisInfo; pcm: **float32; pcmret: **float32; pcm_storage: s32; pcm_current: s32; pcm_returned: s32; preextrapolate: s32; eofflag: s32; lW: isize; W: isize; nW: isize; centerW: isize; granulepos: s64; sequence: s64; glue_bits: s64; time_bits: s64; floor_bits: s64; res_bits: s64; backend_state: *void; }vorbis_dsp_state.
VorbisBlock :: struct { pcm: **float32; opb: OggPackBuffer; lW: isize; W: isize; nW: isize; pcmend: s32; mode: s32; eofflag: s32; granulepos: s64; sequence: s64; vd: *VorbisDspState; localstore: *void; localtop: isize; localalloc: isize; totaluse: isize; reap: *void; glue_bits: isize; time_bits: isize; floor_bits: isize; res_bits: isize; internal: *void; }vorbis_block.
VorbisRead :: #type (destination: *void, size: usize, count: usize, source: *void) -> usizeVorbisSeek :: #type (source: *void, offset: s64, whence: s32) -> s32VorbisClose :: #type (source: *void) -> s32VorbisTell :: #type (source: *void) -> isizeVorbisCallbacks :: struct { read: VorbisRead; seek: VorbisSeek; close: VorbisClose; tell: VorbisTell; }ov_callbacks.
VorbisFile :: struct { datasource: *void; seekable: s32; offset: s64; end: s64; oy: OggSyncState; links: s32; offsets: *s64; dataoffsets: *s64; serialnos: *isize; pcmlengths: *s64; vi: *VorbisInfo; vc: *void; pcm_offset: s64; ready_state: s32; current_serialno: isize; current_link: s32; bittrack: float64; samptrack: float64; os: OggStreamState; vd: VorbisDspState; vb: VorbisBlock; callbacks: VorbisCallbacks; }OggVorbis_File.
VorbisDecode :: (input: []u8, output: *Vec(u8), max_frames: s64, audio: *VorbisAudio) -> boolReplaces OUTPUT with the decoded samples of the single Ogg Vorbis stream INPUT holds: interleaved, signed 16-bit little-endian. False, with OUTPUT empty, for anything else: an empty, damaged or truncated stream, trailing bytes, chained streams, a stream whose decoded length differs from its declared length, or one longer than MAX_FRAMES frames.
VorbisDecoder :: struct { state: *void; info: VorbisAudio; comments: VorbisComments; position: s64; owned: Vec(u8); }Single-owner state over borrowed input, or owned input opened from a file. Keep borrowed bytes alive and unchanged until close. No concurrent calls.
VorbisDecoderClose :: (decoder: *VorbisDecoder)VorbisDecoderOpen :: (decoder: *VorbisDecoder, input: []u8, max_frames: s64) -> s32VorbisDecoderOpenFile :: (decoder: *VorbisDecoder, path: string, max_frames: s64) -> s32VorbisDecoderRead :: (decoder: *VorbisDecoder, output: []float32, frames: *s64) -> s32Fills whole interleaved frames; OK with zero frames denotes the logical end. Discard the output on error, then seek or close.
VorbisDecoderReadS16 :: (decoder: *VorbisDecoder, output: []s16, frames: *s64) -> s32VorbisDecoderSeek :: (decoder: *VorbisDecoder, frame: s64) -> s32VorbisDecoderRewind :: (decoder: *VorbisDecoder) -> s32VorbisDecodeFloat :: (input: []u8, max_frames: s64, output: *PCM) -> s32Whole-file float output is unchanged on error.
VorbisDecodeS16 :: (input: []u8, max_frames: s64, output: *Vec(s16), info: *VorbisAudio) -> s32