Browse thread
ANNOUNCE : libsndfile-ocaml alpha
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Erik de Castro Lopo <mle+ocaml@m...> |
| Subject: | Re: [Caml-list] ANNOUNCE : libsndfile-ocaml alpha |
skaller wrote:
> type ('a, 'b) kind
> To each element kind is associated a Caml type, which is the type of
> Caml values that can be stored in the big array or read back from it.
> This type is not necessarily the same as the type of the array elements
> proper: for instance, a big array whose elements are of kind float32_elt
> contains 32-bit single precision floats, but reading or writing one of
> its elements from Caml uses the Caml type float, which is 64-bit double
> precision floats.
But why is taht any better than the existing Sndfile read method
which already returns an array of Ocmal floats. See:
http://www.mega-nerd.com/libsndfile/Ocaml/Sndfile.html
which has:
val sf_read : sndfile_t -> float array -> int
val sf_write : sndfile_t -> float array -> int
(well actually sndfile_t has been changed to Sndfile.t).
Since it is already possible to read Ocaml floats (which are normalised
to the range [-1.0, 1.0]) why would anyone want to ready any other data
type?
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
"Do I do everything in C++ and teach a course in advanced swearing?"
-- David Beazley at IPC8, on choosing a language for teaching