sig
exception Invalid_frame_size
type mode = Narrowband | Wideband | Ultra_wideband
type control =
SPEEX_RESET_STATE
| SPEEX_SET_ENH
| SPEEX_GET_ENH
| SPEEX_GET_FRAME_SIZE
| SPEEX_SET_QUALITY
| SPEEX_SET_MODE
| SPEEX_GET_MODE
| SPEEX_SET_LOW_MODE
| SPEEX_GET_LOW_MODE
| SPEEX_SET_HIGH_MODE
| SPEEX_GET_HIGH_MODE
| SPEEX_SET_VBR
| SPEEX_GET_VBR
| SPEEX_SET_VBR_QUALITY
| SPEEX_GET_VBR_QUALITY
| SPEEX_SET_COMPLEXITY
| SPEEX_GET_COMPLEXITY
| SPEEX_SET_BITRATE
| SPEEX_GET_BITRATE
| SPEEX_SET_SAMPLING_RATE
| SPEEX_GET_SAMPLING_RATE
| SPEEX_SET_VAD
| SPEEX_GET_VAD
| SPEEX_SET_ABR
| SPEEX_GET_ABR
| SPEEX_SET_DTX
| SPEEX_GET_DTX
| SPEEX_SET_SUBMODE_ENCODING
| SPEEX_GET_SUBMODE_ENCODING
| SPEEX_SET_PLC_TUNING
| SPEEX_GET_PLC_TUNING
| SPEEX_SET_VBR_MAX_BITRATE
| SPEEX_GET_VBR_MAX_BITRATE
| SPEEX_SET_HIGHPASS
| SPEEX_GET_HIGHPASS
| SPEEX_GET_ACTIVITY
module Header :
sig
type t = {
id : string;
version : string;
version_id : int;
header_size : int;
rate : int;
mode : Speex.mode;
mode_bitstream_version : int;
nb_channels : int;
bitrate : int;
frame_size : int;
vbr : bool;
frames_per_packet : int;
extra_headers : int;
}
val header_string_length : int
val header_version_length : int
val init :
?frames_per_packet:int ->
?mode:Speex.mode ->
?vbr:bool -> nb_channels:int -> rate:int -> unit -> Speex.Header.t
val encode_header_packetout :
Speex.Header.t ->
(string * string) list -> Ogg.Stream.packet * Ogg.Stream.packet
val encode_header :
Speex.Header.t -> (string * string) list -> Ogg.Stream.stream -> unit
val header_of_packet : Ogg.Stream.packet -> Speex.Header.t
val comments_of_packet :
Ogg.Stream.packet -> string * (string * string) list
end
module Encoder :
sig
type t
val init : Speex.mode -> int -> Speex.Encoder.t
val get : Speex.Encoder.t -> Speex.control -> int
val set : Speex.Encoder.t -> Speex.control -> int -> unit
val encode_page :
Speex.Encoder.t ->
Ogg.Stream.stream -> (unit -> float array) -> Ogg.Page.t
val encode_page_stereo :
Speex.Encoder.t ->
Ogg.Stream.stream -> (unit -> float array array) -> Ogg.Page.t
val encode_page_int :
Speex.Encoder.t ->
Ogg.Stream.stream -> (unit -> int array) -> Ogg.Page.t
val encode_page_int_stereo :
Speex.Encoder.t ->
Ogg.Stream.stream -> (unit -> int array array) -> Ogg.Page.t
val eos : Speex.Encoder.t -> Ogg.Stream.stream -> unit
end
module Decoder :
sig
type t
val init : Speex.mode -> Speex.Decoder.t
val get : Speex.Decoder.t -> Speex.control -> int
val set : Speex.Decoder.t -> Speex.control -> int -> unit
val decode : Speex.Decoder.t -> Ogg.Stream.stream -> float array list
val decode_stereo :
Speex.Decoder.t -> Ogg.Stream.stream -> float array array list
val decode_feed :
Speex.Decoder.t -> Ogg.Stream.stream -> (float array -> unit) -> unit
val decode_feed_stereo :
Speex.Decoder.t ->
Ogg.Stream.stream -> (float array array -> unit) -> unit
val decode_int : Speex.Decoder.t -> Ogg.Stream.stream -> int array list
val decode_int_stereo :
Speex.Decoder.t -> Ogg.Stream.stream -> int array array list
val decode_int_feed :
Speex.Decoder.t -> Ogg.Stream.stream -> (int array -> unit) -> unit
val decode_int_feed_stereo :
Speex.Decoder.t ->
Ogg.Stream.stream -> (int array array -> unit) -> unit
end
module Wrapper :
sig
module Decoder :
sig
exception Not_speex
type t
val open_sync : Ogg.Sync.t -> Speex.Wrapper.Decoder.t
val open_file : string -> Speex.Wrapper.Decoder.t * Unix.file_descr
val open_feed : (int -> string * int) -> Speex.Wrapper.Decoder.t
val serial : Speex.Wrapper.Decoder.t -> nativeint
val comments : Speex.Wrapper.Decoder.t -> (string * string) list
val header : Speex.Wrapper.Decoder.t -> Speex.Header.t
val decode : Speex.Wrapper.Decoder.t -> float array list
val decode_stereo :
Speex.Wrapper.Decoder.t -> float array array list
val decode_feed :
Speex.Wrapper.Decoder.t -> (float array -> unit) -> unit
val decode_feed_stereo :
Speex.Wrapper.Decoder.t -> (float array array -> unit) -> unit
val decode_int : Speex.Wrapper.Decoder.t -> int array list
val decode_int_stereo :
Speex.Wrapper.Decoder.t -> int array array list
val decode_int_feed :
Speex.Wrapper.Decoder.t -> (int array -> unit) -> unit
val decode_int_feed_stereo :
Speex.Wrapper.Decoder.t -> (int array array -> unit) -> unit
end
end
module Skeleton :
sig
val fisbone :
?start_granule:Stdlib.Int64.t ->
?headers:(string * string) list ->
serialno:nativeint ->
header:Speex.Header.t -> unit -> Ogg.Stream.packet
end
end