sig
exception Buffer_too_small
exception Internal_error
exception Invalid_packet
exception Unimplemented
exception Invalid_state
exception Alloc_fail
val recommended_frame_size : int
val version_string : string
type max_bandwidth =
[ `Full_band
| `Medium_band
| `Narrow_band
| `Super_wide_band
| `Wide_band ]
type bandwidth =
[ `Auto
| `Full_band
| `Medium_band
| `Narrow_band
| `Super_wide_band
| `Wide_band ]
type generic_control =
[ `Get_bandwidth of Opus.bandwidth Stdlib.ref
| `Get_final_range of int Stdlib.ref
| `Get_lsb_depth of int Stdlib.ref
| `Get_pitch of int Stdlib.ref
| `Reset_state
| `Set_lsb_depth of int ]
module Decoder :
sig
type control =
[ `Get_bandwidth of Opus.bandwidth Stdlib.ref
| `Get_final_range of int Stdlib.ref
| `Get_gain of int Stdlib.ref
| `Get_lsb_depth of int Stdlib.ref
| `Get_pitch of int Stdlib.ref
| `Reset_state
| `Set_gain of int
| `Set_lsb_depth of int ]
type t
val check_packet : Ogg.Stream.packet -> bool
val create :
?samplerate:int ->
Ogg.Stream.packet -> Ogg.Stream.packet -> Opus.Decoder.t
val comments : Opus.Decoder.t -> string * (string * string) list
val channels : Opus.Decoder.t -> int
val apply_control : Opus.Decoder.control -> Opus.Decoder.t -> unit
val decode_float :
?decode_fec:bool ->
Opus.Decoder.t ->
Ogg.Stream.stream -> float array array -> int -> int -> int
end
module Encoder :
sig
type application = [ `Audio | `Restricted_lowdelay | `Voip ]
type signal = [ `Auto | `Music | `Voice ]
type bitrate = [ `Auto | `Bitrate of int | `Bitrate_max ]
type control =
[ `Get_application of Opus.Encoder.application
| `Get_bandwidth of Opus.bandwidth Stdlib.ref
| `Get_bitrate of Opus.Encoder.bitrate Stdlib.ref
| `Get_complexity of int Stdlib.ref
| `Get_dtx of bool Stdlib.ref
| `Get_final_range of int Stdlib.ref
| `Get_force_channels of bool Stdlib.ref
| `Get_inband_fec of bool Stdlib.ref
| `Get_lookhead of int
| `Get_lsb_depth of int Stdlib.ref
| `Get_max_bandwidth of Opus.max_bandwidth
| `Get_packet_loss_perc of int Stdlib.ref
| `Get_pitch of int Stdlib.ref
| `Get_samplerate of int
| `Get_signal of Opus.Encoder.signal Stdlib.ref
| `Get_vbr of bool Stdlib.ref
| `Get_vbr_constraint of bool Stdlib.ref
| `Reset_state
| `Set_application of Opus.Encoder.application
| `Set_bandwidth of Opus.bandwidth
| `Set_bitrate of Opus.Encoder.bitrate
| `Set_complexity of int
| `Set_dtx of bool
| `Set_force_channels of bool
| `Set_inband_fec of bool
| `Set_lsb_depth of int
| `Set_max_bandwidth of Opus.max_bandwidth
| `Set_packet_loss_perc of int
| `Set_signal of Opus.Encoder.signal
| `Set_vbr of bool
| `Set_vbr_constraint of bool ]
type t
val create :
?pre_skip:int ->
?comments:(string * string) list ->
?gain:int ->
samplerate:int ->
channels:int ->
application:Opus.Encoder.application ->
Ogg.Stream.stream -> Opus.Encoder.t
val header : Opus.Encoder.t -> Ogg.Stream.packet
val comments : Opus.Encoder.t -> Ogg.Stream.packet
val apply_control : Opus.Encoder.control -> Opus.Encoder.t -> unit
val encode_float :
?frame_size:float ->
Opus.Encoder.t -> float array array -> int -> int -> int
val eos : Opus.Encoder.t -> unit
end
end