Date: Tue, 29 Dec 1998 23:15:53 -0800 From: grady@xcf.berkeley.edu (Steven Grady) To: freebsd-java@FreeBSD.ORG, java-port@FreeBSD.ORG Subject: question about Java Sound Message-ID: <199812300714.XAA12702@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
(I do not subscribe to these mailing lists, so please respond to
me directly.)
Sun just announced the early access of the Java Sound API. This is
something I have been waiting for for a while, because I would like to
write a sophisticated Java sound application under FreeBSD, and the
current interface doesn't cut it. I am wondering what the intention
will be (is?) about what technology to use for the FreeBSD port. I
assume the standard Voxware ioctl's (which I believe is what is used
now). If that is the case, I would like to recommend that the
implementer of the JavaSound .so library keep in mind that other sound
technologies exist (e.g. the KDE sound daemon, the Network Audio
Server, etc.) Please keep the code clean enough to be easily portable
to these other interfaces. Ideally, the user can choose which version
to use by installing the appropriate .so file under lib/i386/green_threads.
Or perhaps I'm assuming too much. Is it likely that anyone will be
taking on the tasking of porting the API, when it becomes available?
Has anyone looked at the early access? Depending on my availability,
I _may_ be able to do it myself when the source becomes available.
BTW, to give a sense of what kind of work will need to be done,
here are all the native methods, as indicated by using javap on
sound.jar, and grepping for "native":
com.sun.media.sound.engine.JSThread
private native void runNative();
com.sun.media.sound.JSAudioInSystemDevice
protected native void nAcquire();
protected native void nInitializeCapture(float, int, int);
protected native void nRelease();
protected native void nSetAudioFormat(float, int, int);
protected native float nSetLinearGain(float);
protected native float nSetPan(float);
protected native void nStart();
protected native void nStop();
protected native boolean nSupportsChannels(int);
protected native boolean nSupportsSampleRate(float);
protected native boolean nSupportsSampleSizeInBits(int);
com.sun.media.sound.JSAudioOutput
protected native int nCreateChannel(int, float, int, int);
protected native void nDestroyChannel(int);
protected native void nDrainChannel(int);
protected native void nFlushChannel(int);
protected native long nGetChannelFrames(int);
protected native void nPauseChannel(int);
protected native void nResumeChannel(int);
protected native float nSetChannelLinearGain(int, float);
protected native float nSetPan(int, float);
protected native int nSetSampleRate(int, int);
protected native void nStartChannel(int);
com.sun.media.sound.JSAudioOutSystemDevice
protected native void nAcquire();
protected native void nAllocateEngineVoices(int, int);
protected native int nGetCurrentData(byte[], byte[], int);
protected native long nGetEngineLatencyInMicroseconds();
protected native void nInitializeEngine(float, int, int, int, int);
protected native void nRelease();
protected native void nSetAudioFormat(float, int, int);
protected native float nSetLinearGain(float);
protected native void nSetOutputCallback(boolean);
protected native float nSetPan(float);
protected native boolean nSetSoundbank(java.lang.String);
protected native void nStart();
protected native void nStop();
protected native boolean nSupportsChannels(int);
protected native boolean nSupportsSampleRate(float);
protected native boolean nSupportsSampleSizeInBits(int);
com.sun.media.sound.JSAudioTimeBase
protected native long nGetSamplesCaptured();
protected native long nGetSamplesPlayed();
com.sun.media.sound.JSLoadableAudioOutput
protected native int nCreateChannel(byte[], int, float, int, int);
protected native void nDestroyChannel(int);
protected native void nDrainChannel(int);
protected native void nFlushChannel(int);
protected native long nGetChannelFrames(int);
protected native float nSetChannelLinearGain(int, float);
protected native float nSetPan(int, float);
protected native int nSetSampleRate(int, int);
com.sun.media.sound.JSMidiChannel
protected native void nAllNotesOff(int, byte, long);
protected native void nControlChange(int, byte, byte, short, long);
protected native void nNoteOff(int, byte, byte, byte, long);
protected native void nNoteOn(int, byte, byte, byte, long);
protected native void nProgramChange(int, byte, byte, long);
protected native void nProgramChange(int, byte, short, byte, long);
protected native void nResetAllControllers(int, byte);
protected native void nSetChannelPressure(int, byte, byte, long);
protected native float nSetLinearGain(int, byte, float);
protected native boolean nSetMute(int, byte, boolean);
protected native void nSetPitchBend(int, byte, byte, byte, long);
protected native void nSetPolyPressure(int, byte, byte, byte, long);
protected native boolean nSetSolo(int, byte, boolean);
com.sun.media.sound.JSMidiOutControlDevice
protected native long nGetSequencerMicroseconds();
private native int nLoadSoundbank(java.lang.String);
private native boolean nSetSoundbank(int);
private native boolean nUnloadSoundbank(int);
com.sun.media.sound.JSMidiPlayer
protected native int nCreateMidiDirect();
protected native void nDestroyChannel(int);
protected native long nGetSequencerMicrosecondPosition(int);
protected native long nGetSequencerTickPosition(int);
protected native boolean nLoadPatch(int, int);
protected native void nPauseChannel(int);
protected native boolean nRemapPatch(int, int, int);
protected native void nResumeChannel(int);
protected native float nSetChannelLinearGain(int, float);
protected native float nSetChannelPan(int, float);
protected native void nStartMidiDirect(int);
protected native boolean nUnloadPatch(int, int);
com.sun.media.sound.JSSequencePlayer
protected native int nCreateMidiSequencer(byte[], int);
protected native int nCreateRmfSequencer(byte[], int);
protected native long nGetSequenceMicrosecondLength(int);
protected native long nGetSequenceTickLength(int);
protected native long nGetSequencerMicrosecondPosition(int);
protected native long nGetSequencerTickPosition(int);
protected native int nGetTempoInBPM(int);
protected native int nGetTempoInMPQ(int);
protected native long nSetSequencerMicrosecondPosition(int, long);
protected native long nSetSequencerTickPosition(int, long);
protected native int nSetTempoInBPM(int, int);
protected native int nSetTempoInMPQ(int, int);
protected native void nStartSequencer(int);
com.sun.media.sound.JSSoundbank
protected native java.lang.String nGetName();
protected native int nGetVersionMajor();
protected native int nGetVersionMinor();
protected native int nGetVersionSubMinor();
protected native com.sun.media.sound.HsbResource nListEmbeddedSequences()[];
protected native com.sun.media.sound.HsbResource nListPatches()[];
--
Steven
grady@xcf.berkeley.edu
"No egg nog! In fact, no nog, period!"
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?199812300714.XAA12702>
