From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 1C44DBC0A for ; Sun, 31 Dec 2006 20:05:24 +0100 (CET) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBVJ5JiP011610 for ; Sun, 31 Dec 2006 20:05:23 +0100 Received: from ppp14-213.lns2.syd7.internode.on.net (HELO rosella) ([59.167.14.213]) by ipmail02.adl2.internode.on.net with ESMTP; 01 Jan 2007 05:35:17 +1030 X-IronPort-AV: i="4.12,222,1165152600"; d="scan'208"; a="66227224:sNHT23068780" Subject: Re: [Caml-list] ANNOUNCE : libsndfile-ocaml alpha From: skaller To: Erik de Castro Lopo Cc: caml-list@yquem.inria.fr In-Reply-To: <20061231152305.694fd3e9.mle+ocaml@mega-nerd.com> References: <20061222155407.ebe6c272.mle+ocaml@mega-nerd.com> <45923DC2.9000504@ujf-grenoble.fr> <20061227211046.656615d0.mle+ocaml@mega-nerd.com> <20061231080756.66e89d6c.mle+ocaml@mega-nerd.com> <1167535885.27287.66.camel@rosella.wigram> <20061231152305.694fd3e9.mle+ocaml@mega-nerd.com> Content-Type: text/plain Date: Mon, 01 Jan 2007 06:05:14 +1100 Message-Id: <1167591914.5340.1.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 459809EF.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; elt:01 ocaml:01 val:01 val:01 ocaml:01 1.0:98 sourceforge:01 wrote:01 wrote:01 caml-list:01 int:01 int:01 data:02 caml:02 caml:02 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 Felix, successor to C++: http://felix.sf.net