File: mp3info.ml

package info (click to toggle)
ocaml-mad 0.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 212 kB
  • sloc: ml: 450; ansic: 422; makefile: 3
file content (9 lines) | stat: -rw-r--r-- 297 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
let info file =
  let mf = Mad.openfile file in
  ignore (Mad.decode_frame mf);
  let sample_freq, channels, _ = Mad.get_output_format mf in
  Mad.close mf;
  Printf.printf "Samplefreq:\t%dHz\nChannels\t%d\nDuration:\t%fs\n" sample_freq
    channels (Mad.duration file)

let _ = info Sys.argv.(1)