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: | skaller <skaller@u...> |
| Subject: | Re: [Caml-list] ANNOUNCE : libsndfile-ocaml alpha |
On Sun, 2006-12-31 at 15:23 +1100, Erik de Castro Lopo wrote:
> 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.
I don't claim it is .. just answering your question, which
was about how to use an array of, for example, shorts.
> 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?
Performance or space issues?
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net