Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2002 23:55:14 +0100
From:      Mats Peterson <mats_peterson@swipnet.se>
To:        freebsd-java@freebsd.org
Subject:   getInstruments() returns empty array
Message-ID:  <3C72D7D2.CFE1924B@swipnet.se>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C72D7D2.CFE1924B>