From owner-freebsd-java Tue Feb 19 14:49:53 2002 Delivered-To: freebsd-java@freebsd.org Received: from fep02-svc.swip.net (fep02.swip.net [130.244.199.130]) by hub.freebsd.org (Postfix) with ESMTP id 6DA9537B416 for ; Tue, 19 Feb 2002 14:49:46 -0800 (PST) Received: from swipnet.se ([212.151.132.196]) by fep02-svc.swip.net with ESMTP id <20020219224944.CBBR9552.fep02-svc.swip.net@swipnet.se> for ; Tue, 19 Feb 2002 23:49:44 +0100 Message-ID: <3C72D7D2.CFE1924B@swipnet.se> Date: Tue, 19 Feb 2002 23:55:14 +0100 From: Mats Peterson X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-java@freebsd.org Subject: getInstruments() returns empty array Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello. I am using JDK 1.3.1 on FreeBSD with appropriate patches added. I get an empty array from the getInstruments() method of the Soundbank interface. Maybe this is a FreeBSD specific bug, I don't know. In any case, it would be nice to hear if anyone else has the same problem. Below is a short example. Best Regards, Mats Peterson -------------------------------------------------------------------------------- import javax.sound.midi.*; import java.io.*; public class SbTest { public static void main(String args[]) { Synthesizer synthesizer = null; Soundbank sb; Instrument instruments[]; try { if ((synthesizer = MidiSystem.getSynthesizer()) == null) { System.out.println("getSynthesizer() failed!"); System.exit(1); } synthesizer.open(); } catch (Exception ex) { ex.printStackTrace(); System.exit(1); } if ((sb = synthesizer.getDefaultSoundbank()) == null) { System.out.println("Couldn't get default sound bank"); System.exit(1); } /* The following returns an empty array with JDK 1.3.1 in FreeBSD */ instruments = sb.getInstruments(); if (instruments.length == 0) { System.out.println("Empty instruments[] array"); System.exit(1); } System.exit(0); } } ------------------------------------------------------------------------ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message