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=none autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 69378BC0B for ; Sat, 30 Dec 2006 22:08:09 +0100 (CET) Received: from smtp.syd.people.net.au (smtp.syd.people.net.au [218.214.225.98]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id kBUL85Qq029816 for ; Sat, 30 Dec 2006 22:08:08 +0100 Received: (qmail 27399 invoked from network); 30 Dec 2006 21:08:02 -0000 Received: from unknown (HELO coltrane.mega-nerd.net) (218.214.64.136) by smtp.syd.people.net.au with SMTP; 30 Dec 2006 21:08:02 -0000 Received: from coltrane (coltrane [192.168.1.101]) by coltrane.mega-nerd.net (Postfix) with SMTP id D24127B9A; Sun, 31 Dec 2006 08:07:56 +1100 (EST) Date: Sun, 31 Dec 2006 08:07:56 +1100 From: Erik de Castro Lopo To: "Vu Ngoc San" , caml-list@yquem.inria.fr Subject: Re: [Caml-list] ANNOUNCE : libsndfile-ocaml alpha Message-Id: <20061231080756.66e89d6c.mle+ocaml@mega-nerd.com> In-Reply-To: <20061227211046.656615d0.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> Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4596D535.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 optionally:01 bigarray:01 ocaml:01 bigarray:01 interfacing:01 wrote:01 wrote:01 caml-list:01 ints:01 api:01 short:01 int:01 data:02 data:02 Erik de Castro Lopo wrote: > Vu Ngoc San wrote: > > > haven't had the time to really test it, but it seems to work nicely. > > Wouldn't it be interesting to optionally create a bigarray instead of an > > array ? > > Wow, I've just looked up the Ocaml bigarray module. I didn't even > know it existed. I'll take a look at it. It may be a better solution > than what I have now. After a more detailed look at this I don't see any advantage to using the bigarray module. The C API for libsndfile allows reading data as short, int, float or double. During reads, libsndfile automatically converts from the internal data format of the file to the data format requested by the user. The trouble interfacing with Ocaml is that Ocaml doesn't support 16 bit shorts, 32 bit ints or 32 bit floats. The only data type that makes any sense is the Ocaml float type (C double). So, I'd like to ask, if I provide a bigarray interface, how would it be used? Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ "There are two kinds of large software systems: those that evolved from small systems and those that don't work." -- Seen on slashdot.org, then quoted by amk