We write on an open source Voice over IP Software (computer science
project) and have problems with the CrossPlattform package of JMF
(tested on Mac OS X 10.4.5). We can not capture sound from an input
device like a microphone or headset. The headset was tested with
Skype on the same machine and worked fine.
JMF-2.1.1e is installed and jmf.jar is in JAVA Build Path added to
Libraries on Eclipse.
I also tested javax.sound with JavaSoundDemo and the record function
worked fine here with following Configuration:
linear, 44100 samplerate, 16 Bit, signed, big endian, stereo (only
linear and 44100 must be fix, otherwise I get not supported ERROR).
On windows we get no error but we don't use CrossPlatform package there!
What can I do for fixing this issue?
call constructor:
=================
int samplerate = 44100;
RTPSender sender = new RTPSender(
"192.168.0.2",
10000,
new AudioFormat(AudioFormat.LINEAR, samplerate, 16, 2)
);
constructor:
============
public RTPSender(String ipAddress, int port, Format format) {
this.ipAddress = ipAddress;
this.port = port;
this.format = format;
System.out.println("format: "+ format.toString());
// get list of supported audio devices
Vector deviceList = CaptureDeviceManager.getDeviceList(null);
// print CaptureDevices
for (Object d : deviceList) {
System.out.println("DEBUG: available locator: "
+ ((CaptureDeviceInfo) d).getLocator().toString());
}
if (deviceList.size() > 0) {
// take first element and set it
// Nehme das erste Element und setze es als Locator
di = (CaptureDeviceInfo) deviceList.firstElement();
locator = di.getLocator();
System.out.println("DEBUG: used format: " + locator.toString());
} else {
System.err.println("ERROR: No Device Info found");
}
}
I get this message:
format: LINEAR, 44100.0 Hz, 16-bit, Stereo
DEBUG: available locator: javasound://44100
DEBUG: used format: javasound://44100
Exception in thread "JavaSound PushThread"
java.lang.IllegalArgumentException: Illegal request to write non-
integral number of frames (22050 bytes )
at com.sun.media.sound.SimpleInputDevice$InputDeviceDataLine.read
(SimpleInputDevice.java:514)
at com.sun.media.protocol.javasound.PushThread.process
(JavaSoundSourceStream.java:790)
at com.sun.media.util.LoopThread.run(LoopThread.java:135)
LOG: supported Formats: dvi/rtp, 8000.0 Hz, 4-bit, Mono
LOG: supported Formats: dvi/rtp, 11025.0 Hz, 4-bit, Mono
LOG: supported Formats: dvi/rtp, 22050.0 Hz, 4-bit, Mono
LOG: supported Formats: ULAW/rtp, 8000.0 Hz, 8-bit, Mono, FrameSize=8
bits
LOG: supported Formats: gsm/rtp, 8000.0 Hz, Mono, FrameSize=264 bits
LOG: Track 0 is set to transmit as:
LINEAR, 44100.0 Hz, 16-bit, Stereo
Created RTP session: 192.168.0.2 10000
I hope you can help me.
Greets,
Sandor Szücs
--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden