1 ! Copyright (C) 2007 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: kernel system combinators alien alien.syntax ogg ;
9 { [ os winnt? ] [ "vorbis.dll" ] }
10 { [ os macosx? ] [ "libvorbis.0.dylib" ] }
11 { [ os unix? ] [ "libvorbis.so" ] }
12 } cond "cdecl" add-library
21 { "long" "bitrate_upper" }
22 { "long" "bitrate_nominal" }
23 { "long" "bitrate_lower" }
24 { "long" "bitrate_window" }
25 { "void*" "codec_setup"}
28 C-STRUCT: vorbis_dsp_state
30 { "vorbis_info*" "vi" }
32 { "float**" "pcmret" }
33 { "int" "pcm_storage" }
34 { "int" "pcm_current" }
35 { "int" "pcm_returned" }
36 { "int" "preextrapolate" }
42 { "longlong" "granulepos" }
43 { "longlong" "sequence" }
44 { "longlong" "glue_bits" }
45 { "longlong" "time_bits" }
46 { "longlong" "floor_bits" }
47 { "longlong" "res_bits" }
48 { "void*" "backend_state" }
56 C-STRUCT: vorbis_block
58 { "oggpack_buffer" "opb" }
65 { "longlong" "granulepos" }
66 { "longlong" "sequence" }
67 { "vorbis_dsp_state*" "vd" }
68 { "void*" "localstore" }
70 { "long" "localalloc" }
72 { "alloc_chain*" "reap" }
73 { "long" "glue_bits" }
74 { "long" "time_bits" }
75 { "long" "floor_bits" }
77 { "void*" "internal" }
80 C-STRUCT: vorbis_comment
81 { "char**" "usercomments" }
82 { "int*" "comment_lengths" }
87 FUNCTION: void vorbis_info_init ( vorbis_info* vi ) ;
88 FUNCTION: void vorbis_info_clear ( vorbis_info* vi ) ;
89 FUNCTION: int vorbis_info_blocksize ( vorbis_info* vi, int zo ) ;
90 FUNCTION: void vorbis_comment_init ( vorbis_comment* vc ) ;
91 FUNCTION: void vorbis_comment_add ( vorbis_comment* vc, char* comment ) ;
92 FUNCTION: void vorbis_comment_add_tag ( vorbis_comment* vc, char* tag, char* contents ) ;
93 FUNCTION: char* vorbis_comment_query ( vorbis_comment* vc, char* tag, int count ) ;
94 FUNCTION: int vorbis_comment_query_count ( vorbis_comment* vc, char* tag ) ;
95 FUNCTION: void vorbis_comment_clear ( vorbis_comment* vc ) ;
96 FUNCTION: int vorbis_block_init ( vorbis_dsp_state* v, vorbis_block* vb ) ;
97 FUNCTION: int vorbis_block_clear ( vorbis_block* vb ) ;
98 FUNCTION: void vorbis_dsp_clear ( vorbis_dsp_state* v ) ;
99 FUNCTION: double vorbis_granule_time ( vorbis_dsp_state* v, longlong granulepos ) ;
100 FUNCTION: int vorbis_analysis_init ( vorbis_dsp_state* v, vorbis_info* vi ) ;
101 FUNCTION: int vorbis_commentheader_out ( vorbis_comment* vc, ogg_packet* op ) ;
102 FUNCTION: int vorbis_analysis_headerout ( vorbis_dsp_state* v,
106 ogg_packet* op_code ) ;
107 FUNCTION: float** vorbis_analysis_buffer ( vorbis_dsp_state* v, int vals ) ;
108 FUNCTION: int vorbis_analysis_wrote ( vorbis_dsp_state* v, int vals ) ;
109 FUNCTION: int vorbis_analysis_blockout ( vorbis_dsp_state* v, vorbis_block* vb ) ;
110 FUNCTION: int vorbis_analysis ( vorbis_block* vb, ogg_packet* op ) ;
111 FUNCTION: int vorbis_bitrate_addblock ( vorbis_block* vb ) ;
112 FUNCTION: int vorbis_bitrate_flushpacket ( vorbis_dsp_state* vd,
114 FUNCTION: int vorbis_synthesis_headerin ( vorbis_info* vi, vorbis_comment* vc,
116 FUNCTION: int vorbis_synthesis_init ( vorbis_dsp_state* v, vorbis_info* vi ) ;
117 FUNCTION: int vorbis_synthesis_restart ( vorbis_dsp_state* v ) ;
118 FUNCTION: int vorbis_synthesis ( vorbis_block* vb, ogg_packet* op ) ;
119 FUNCTION: int vorbis_synthesis_trackonly ( vorbis_block* vb, ogg_packet* op ) ;
120 FUNCTION: int vorbis_synthesis_blockin ( vorbis_dsp_state* v, vorbis_block* vb ) ;
121 FUNCTION: int vorbis_synthesis_pcmout ( vorbis_dsp_state* v, float*** pcm ) ;
122 FUNCTION: int vorbis_synthesis_lapout ( vorbis_dsp_state* v, float*** pcm ) ;
123 FUNCTION: int vorbis_synthesis_read ( vorbis_dsp_state* v, int samples ) ;
124 FUNCTION: long vorbis_packet_blocksize ( vorbis_info* vi, ogg_packet* op ) ;
125 FUNCTION: int vorbis_synthesis_halfrate ( vorbis_info* v, int flag ) ;
126 FUNCTION: int vorbis_synthesis_halfrate_p ( vorbis_info* v ) ;
128 : OV_FALSE ( -- number ) -1 ; inline
129 : OV_EOF ( -- number ) -2 ; inline
130 : OV_HOLE ( -- number ) -3 ; inline
131 : OV_EREAD ( -- number ) -128 ; inline
132 : OV_EFAULT ( -- number ) -129 ; inline
133 : OV_EIMPL ( -- number ) -130 ; inline
134 : OV_EINVAL ( -- number ) -131 ; inline
135 : OV_ENOTVORBIS ( -- number ) -132 ; inline
136 : OV_EBADHEADER ( -- number ) -133 ; inline
137 : OV_EVERSION ( -- number ) -134 ; inline
138 : OV_ENOTAUDIO ( -- number ) -135 ; inline
139 : OV_EBADPACKET ( -- number ) -136 ; inline
140 : OV_EBADLINK ( -- number ) -137 ; inline
141 : OV_ENOSEEK ( -- number ) -138 ; inline