⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unavorbisapi.pas

📁 Voice Communicator (VC) 一套处理音频压缩的的控件包
💻 PAS
📖 第 1 页 / 共 5 页
字号:
procedure vorbis_comment_init(const vc: tVorbis_comment);
procedure vorbis_comment_add(const vc: tVorbis_comment; comment: pChar);
procedure vorbis_comment_add_tag(var vc: tVorbis_comment; tag: pChar; contents: pChar);
function vorbis_comment_query(const vc: tVorbis_comment; tag: pChar; count: int): pChar;
function vorbis_comment_query_count(const vc: tVorbis_comment; tag: pChar): int;
procedure vorbis_comment_clear(const vc: tVorbis_comment);
function vorbis_block_init(const v: tVorbis_dsp_state; var vb: tVorbis_block): int;
function vorbis_block_clear(const vb: tVorbis_block): int;
procedure vorbis_dsp_clear(const v: tVorbis_dsp_state);
function vorbis_analysis_init(var v: tVorbis_dsp_state; const vi: tVorbis_info): int;
function vorbis_commentheader_out(const vc: tVorbis_comment; const op: tOgg_packet): int;
function vorbis_analysis_headerout(const v: tVorbis_dsp_state; const vc: tVorbis_comment; const op: tOgg_packet; const op_comm: tOgg_packet; const op_code: tOgg_packet): int;
function vorbis_analysis_buffer(const v: tVorbis_dsp_state; vals: int): pSingleSamples; // float **
function vorbis_analysis_wrote(const v: tVorbis_dsp_state; vals: int): int;
function vorbis_analysis_blockout(const v: tVorbis_dsp_state; const vb: tVorbis_block): int;
function vorbis_analysis(const vb: tVorbis_block; op: pOgg_packet): int;
function vorbis_bitrate_addblock(const vb: tVorbis_block): int;
function vorbis_bitrate_flushpacket(const vd: tVorbis_dsp_state; const op: tOgg_packet): int;
function vorbis_synthesis_headerin(const vi: tVorbis_info; const vc: tVorbis_comment; const op: tOgg_packet): int;
function vorbis_synthesis_init(const v: tVorbis_dsp_state; const vi: tVorbis_info): int;
function vorbis_synthesis(const vb: tVorbis_block; const op: tOgg_packet): int;
function vorbis_synthesis_trackonly(const vb: tVorbis_block; const op: tOgg_packet): int;
function vorbis_synthesis_blockin(const v: tVorbis_dsp_state; const vb: tVorbis_block): int;
function vorbis_synthesis_pcmout(const v: tVorbis_dsp_state; var pcm: pSingleSamples {float **}): int;
function vorbis_synthesis_read(const v: tVorbis_dsp_state; const samples: int): int;
function vorbis_packet_blocksize(const vi: tVorbis_info; const op: tOgg_packet): long;


(********************************************************************
 *                                                                  *
 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
 *                                                                  *
 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
 * by the XIPHOPHORUS Company http://www.xiph.org/                  *
 *                                                                  *
 ********************************************************************

 function: vorbis encode-engine setup
 last mod: $Id: vorbisenc.h,v 1.10 2002/07/01 11:20:10 xiphmont Exp $

 ********************************************************************)

type

//extern int vorbis_encode_init(vorbis_info *vi, long channels, long rate, long max_bitrate, long nominal_bitrate, long min_bitrate);
  tvorbis_encode_init = function(const vi: tVorbis_info; channels, rate, max_bitrate, nominal_bitrate, min_bitrate: long): int; cdecl;

//extern int vorbis_encode_setup_managed(vorbis_info *vi, long channels, long rate, long max_bitrate, long nominal_bitrate, long min_bitrate);
  tvorbis_encode_setup_managed = function(const vi: tVorbis_info; channels, rate, max_bitrate, nominal_bitrate, min_bitrate: int): int; cdecl;

//extern int vorbis_encode_setup_vbr(vorbis_info *vi, long channels, long rate, float /* quality level from 0. (lo) to 1. (hi) */ );
  tvorbis_encode_setup_vbr = function(const vi: tVorbis_info; channels, rate: long; quality: single { quality level from 0. (lo) to 1. (hi) }): int; cdecl;

//extern int vorbis_encode_init_vbr(vorbis_info *vi, long channels, long rate, float base_quality /* quality level from 0. (lo) to 1. (hi) */ );
  tvorbis_encode_init_vbr = function(var vi: tVorbis_info; channels, rate: long; base_quality: single { quality level from 0. (lo) to 1. (hi) }): int; cdecl;

//extern int vorbis_encode_setup_init(vorbis_info *vi);
  tvorbis_encode_setup_init = function(const vi: tVorbis_info): int; cdecl;

//extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
  tvorbis_encode_ctl = function(const vi: tVorbis_info; number: int; arg: pointer): int; cdecl;

const
  // --  --
  OV_ECTL_RATEMANAGE_GET	= $10;
  OV_ECTL_RATEMANAGE_SET	= $11;
  OV_ECTL_RATEMANAGE_AVG	= $12;
  OV_ECTL_RATEMANAGE_HARD	= $13;

  OV_ECTL_LOWPASS_GET		= $20;
  OV_ECTL_LOWPASS_SET		= $21;

  OV_ECTL_IBLOCK_GET		= $30;
  OV_ECTL_IBLOCK_SET		= $31;


type
  // --  --
  pOvectl_ratemanage_arg = ^tOvectl_ratemanage_arg;
  tOvectl_ratemanage_arg = packed record
    management_active: int;
    //
    bitrate_hard_min: long;
    bitrate_hard_max: long;
    bitrate_hard_window: double;
    //
    bitrate_av_lo: long;
    bitrate_av_hi: long;
    bitrate_av_window: double;
    bitrate_av_window_center: double;
  end;


// ---------------------------------------------

function vorbis_encode_init(const vi: tVorbis_info; channels, rate, max_bitrate, nominal_bitrate, min_bitrate: long): int;
function vorbis_encode_setup_managed(const vi: tVorbis_info; channels, rate, max_bitrate, nominal_bitrate, min_bitrate: int): int;
function vorbis_encode_setup_vbr(const vi: tVorbis_info; channels, rate: long; quality: single { quality level from 0. (lo) to 1. (hi) }): int;
function vorbis_encode_init_vbr(var vi: tVorbis_info; channels, rate: long; base_quality: single { quality level from 0. (lo) to 1. (hi) }): int;
function vorbis_encode_setup_init(const vi: tVorbis_info): int;
function vorbis_encode_ctl(const vi: tVorbis_info; number: int; arg: pointer): int;

(********************************************************************
 *                                                                  *
 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
 *                                                                  *
 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
 * by the XIPHOPHORUS Company http://www.xiph.org/                  *
 *                                                                  *
 ********************************************************************

 function: stdio-based convenience library for opening/seeking/decoding
 last mod: $Id: vorbisfile.h,v 1.17 2002/03/07 03:41:03 xiphmont Exp $

 ********************************************************************)

type

(* The function prototypes for the callbacks are basically the same as for
 * the stdio functions fread, fseek, fclose, ftell.
 * The one difference is that the FILE * arguments have been replaced with
 * a void * - this is to be used as a pointer to whatever internal data these
 * functions might need. In the stdio case, it's just a FILE * cast to a void *
 *
 * If you use other functions, check the docs for these functions and return
 * the right values. For seek_func(), you *MUST* return -1 if the stream is
 * unseekable
 *)


//  size_t (*read_func)  (void *ptr, size_t size, size_t nmemb, void *datasource);
  tvorbiscb_read_func = function(ptr: pointer; size: int; nmemb: int; datasource: pointer): int; cdecl;

//  int    (*seek_func)  (void *datasource, ogg_int64_t offset, int whence);
  tvorbiscb_seek_func = function(datasource: pointer; offset: ogg_int64_t; whence: int): int; cdecl;

//  int    (*close_func) (void *datasource);
  tvorbiscb_close_func = function(datasource: pointer): int; cdecl;

//  long   (*tell_func)  (void *datasource);
  tvorbiscb_tell_func = function(datasource: pointer): long; cdecl;


  // --  --
  pOv_callbacks = ^tOv_callbacks;
  tOv_callbacks = packed record
    read_func: tvorbiscb_read_func;
    seek_func: tvorbiscb_seek_func;
    close_func: tvorbiscb_close_func;
    tell_func: tvorbiscb_tell_func;
  end;

const
  NOTOPEN   = 0;
  PARTOPEN  = 1;
  OPENED    = 2;
  STREAMSET = 3;
  INITSET   = 4;


type
  // --  --
  pOggVorbis_File = ^tOggVorbis_File;
  tOggVorbis_File = packed record
    datasource: pointer; //* Pointer to a FILE *, etc. */
    seekable: int;
    offset: ogg_int64_t;
    _end: ogg_int64_t;
    oy: tOgg_sync_state;

    //* If the FILE handle isn't seekable (eg, a pipe), only the current
    //   stream appears */
    links: int;
    offsets: ^ogg_int64_t;
    dataoffsets: ogg_int64_t;
    serialnos: ^long;
    pcmlengths: ^ogg_int64_t; //* overloaded to maintain binary
			      //	    compatability; x2 size, stores both
			      //	    beginning and end values */
    vi: pVorbis_info;
    vc: pVorbis_comment;

    //* Decoding working state local storage */
    pcm_offset: ogg_int64_t;
    ready_state: int;
    current_serialno: long;
    current_link: int;
    //
    bittrack: double;
    samptrack: double;

    os: tOgg_stream_state; //* take physical pages, weld into a logical stream of packets */
    vd: tVorbis_dsp_state; //* central working state for the packet->PCM decoder */
    vb: tVorbis_block; //* local working space for packet->PCM decode */

    callbacks: tOv_callbacks;
  end;

  _FILE = int;

//extern int ov_clear(OggVorbis_File *vf);
  tov_clear = function(const vf: tOggVorbis_File): int; cdecl;

//extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
  tov_open = function(const f: _FILE; const vf: tOggVorbis_File; initial: pChar; ibytes: long): int; cdecl;

//extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks);
  tov_open_callbacks = function(datasource: pointer; const vf: tOggVorbis_File; initial: pChar; ibytes: long; callbacks: tOv_callbacks): int; cdecl;

// --  --

//extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
  tov_test = function(const f: _FILE; const vf: tOggVorbis_File; initial: pChar; ibytes: long): int; cdecl;

//extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks);
  tov_test_callbacks = function(datasource: pointer; const vf: tOggVorbis_File; initial: pChar; ibytes: long; callbacks: tOv_callbacks): int; cdecl;

//extern int ov_test_open(OggVorbis_File *vf);
  tov_test_open = function(const vf: tOggVorbis_File): int; cdecl;

// --  --

//extern long ov_bitrate(OggVorbis_File *vf,int i);
  tov_bitrate = function(const vf: tOggVorbis_File; i: int): long; cdecl;

//extern long ov_bitrate_instant(OggVorbis_File *vf);
  tov_bitrate_instant = function(const vf: tOggVorbis_File): long; cdecl;

//extern long ov_streams(OggVorbis_File *vf);
  tov_streams = function(const vf: tOggVorbis_File): long; cdecl;

//extern long ov_seekable(OggVorbis_File *vf);
  tov_seekable = function(const vf: tOggVorbis_File): long; cdecl;

//extern long ov_serialnumber(OggVorbis_File *vf,int i);
  tov_serialnumber = function(const vf: tOggVorbis_File; i: int): long; cdecl;

// --  --

//extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
  tov_raw_total = function(const vf: tOggVorbis_File; i: int): ogg_int64_t; cdecl;

//extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
  tov_pcm_total = function(const vf: tOggVorbis_File; i: int): ogg_int64_t; cdecl;

//extern double ov_time_total(OggVorbis_File *vf,int i);
  tov_time_total = function(const vf: tOggVorbis_File; i: int): double; cdecl;

// --  --

//extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
  tov_raw_seek = function(const vf: tOggVorbis_File; pos: ogg_int64_t): int; cdecl;

//extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
  tov_pcm_seek = function(const vf: tOggVorbis_File; pos: ogg_int64_t): int; cdecl;

//extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
  tov_pcm_seek_page = function(const vf: tOggVorbis_File; pos: ogg_int64_t): int; cdecl;

//extern int ov_time_seek(OggVorbis_File *vf,double pos);
  tov_time_seek = function(const vf: tOggVorbis_File; pos: double): int; cdecl;

//extern int ov_time_seek_page(OggVorbis_File *vf,double pos);
  tov_time_seek_page = function(const vf: tOggVorbis_File; pos: double): int; cdecl;

// --  --

//extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
  tov_raw_tell = function(const vf: tOggVorbis_File): ogg_int64_t; cdecl;

//extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
  tov_pcm_tell = function(const vf: tOggVorbis_File): ogg_int64_t; cdecl;

//extern double ov_time_tell(OggVorbis_File *vf);
  tov_time_tell = function(const vf: tOggVorbis_File): double; cdecl;

// --  --

//extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
  tov_info = function(const vf: tOggVorbis_File; link: int): pVorbis_info; cdecl;

//extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
  tov_comment = function(const vf: tOggVorbis_File; link: int): pVorbis_comment; cdecl;

// --  --

//extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples, int *bitstream);
  tov_read_float = function(const vf: tOggVorbis_File; var pcm_channels: pSingleSamples{float **}; samples: int; var bitstream: int): long; cdecl;

//extern long ov_read(OggVorbis_File *vf,char *buffer,int length, int bigendianp,int word,int sgned,int *bitstream);
  tov_read = function(const vf: tOggVorbis_File; buffer: pChar; length, bigendianp, _word, sgned: int; var bitstream: int): long; cdecl;


// ---------------------------------------------------

function ov_clear(const vf: tOggVorbis_File): int;
function ov_open(const f: _FILE; const vf: tOggVorbis_File; initial: pChar; ibytes: long): int;
function ov_open_callbacks(datasource: pointer; const vf: tOggVorbis_File; initial: pChar; ibytes: long; callbacks: tOv_callbacks): int;
function ov_test(const f: _FILE; const vf: tOggVorbis_File; initial: pChar; ibytes: long): int;
function ov_test_callbacks(datasource: pointer; const vf: tOggVorbis_File; initial: pChar; ibytes: long; callbacks: tOv_callbacks): int;
function ov_test_open(const vf: tOggVorbis_File): int;
function ov_bitrate(const vf: tOggVorbis_File; i: int): long;
function ov_bitrate_instant(const vf: tOggVorbis_File): long;
function ov_streams(const vf: tOggVorbis_File): long;
function ov_seekable(const vf: tOggVorbis_File): long;
function ov_serialnumber(const vf: tOggVorbis_File; i: int): long;
function ov_raw_total(const vf: tOggVorbis_File; i: int): ogg_int64_t;
function ov_pcm_total(const vf: tOggVorbis_File; i: int): ogg_int64_t;
function ov_time_total(const vf: tOggVorbis_File; i: int): double;
function ov_raw_seek(const vf: tOggVorbis_File; pos: ogg_int64_t): int;
function ov_pcm_seek(const vf: tOggVorbis_File; pos: ogg_int64_t): int;
function ov_pcm_seek_page(const vf: tOggVorbis_File; pos: ogg_int64_t): int;
function ov_time_seek(const vf: tOggVorbis_File; pos: double): int;
function ov_time_seek_page(const vf: tOggVorbis_File; pos: double): int;
function ov_raw_tell(const vf: tOggVorbis_File): ogg_int64_t;
function ov_pcm_tell(const vf: tOggVorbis_File): ogg_int64_t;
function ov_time_tell(const vf: tOggVorbis_File): double;
function ov_info(const vf: tOggVorbis_File; link: int): pVorbis_info;
function ov_comment(const vf: tOggVorbis_File; link: int): pVorbis_comment;
function ov_read_float(const vf: tOggVorbis_File; var pcm_channels: pSingleSamples{float **}; samples: int; var bitstream: int): long;
function ov_read(const vf: tOggVorbis_File; buffer: pChar; length, bigendianp, _word, sgned: int; var bitstream: int): long;

// ---------------------------------------

const

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -