module Mp4:sig
..end
typedecoder =
Faad.t
type
t
An MP4 reader.
typetrack =
int
A track number.
typesample =
int
A sample number.
val is_mp4 : string -> bool
Detect whether the file is an MP4 given at least 8 bytes of its header.
val openfile : ?write:(Stdlib.Bytes.t -> int) ->
?seek:(int -> int) ->
?trunc:(unit -> int) -> (int -> Stdlib.Bytes.t * int * int) -> t
Open an MP4 file.
val openfile_fd : Unix.file_descr -> t
val tracks : t -> int
Total number of tracks.
val find_aac_track : t -> track
Find the first AAC track.
val init : t -> decoder -> track -> int * int
Initialize a decoder.
val seek : t -> track -> int -> int * int
Seek to the given offset, in audio samples.
returns a pair sample,toskip
where
sample
is the new current (mp4) sample
and toskip
is an amount of audio sample
that should be skipped.
val samples : t -> track -> int
val read_sample : t -> track -> sample -> string
val decode : t ->
track -> sample -> decoder -> float array array
val metadata : t -> (string * string) array