My guess is that the problem is just what the message of the
IllegalArgumentException says it is. You are asking the audio-
device to
transfer a number of bytes that isn't an integral number of sampled-
audio
frames, for the format in use.
I tested different combinations of AudioFormat. It seems that there
are problems in All-java JMF version. Related on this website [1] (3)
Maybe I missunderstood your hint but I also get this error with
following configuration:
dvi/rtp, 8000.0 Hz, 4-bit, Mono
or as you can see with
gsm/rtp, 8000.0 Hz, Mono, FrameSize=264 bits
- Open RTP session for: addr: 10.1.2.10 port: 10000 ttl: 1
DEBUG: available locator: javasound://44100
DEBUG: used format: javasound://44100
- Waiting for RTP data to arrive...
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)
- Waiting for RTP data to arrive...
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
Track 0 is set to transmit as:
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
gsm/rtp, 8000.0 Hz, Mono, FrameSize=264 bits
- Waiting for RTP data to arrive...
- Waiting for RTP data to arrive...
Created RTP session: 10.1.2.10 10002
- Waiting for RTP data to arrive...
Connection terminated
Your format is 44100 Hz, 16-bit, stereo. That means each sample-
frame is
two 16-bit samples, or 4 bytes. Apparently, the transfer-size
you're using
is 22050 bytes in length. Divide 22050 bytes by 4 and you get 5512.5,
which is non-integral: i.e. not an integer number. In effect, you're
asking to transfer only half of the last sample-frame.
Pick a transfer size (or buffer size) that is an exact integer
multiple of
4 bytes, and the IllegalArgumentException should disappear.
Calculation: 22050 / (1*1/2) = 44100
1 := mono
1/2 := 4 Bit
I think I missunderstood something or?
Or use mono format, which has 2 bytes per sample-frame and does divide
integrally into 22050. I don't see much reason to sample in stereo
for
transmission as VOIP, but I may be missing something.
Yes you are right there is no reason to use stereo.
I also sniffed the nettwork traffic and I see that the windows box
sent rtp traffic, but my Mac OS X 10.4 PowerBook didn't answer! The
interesting part is that rtcp connection in both direction seems to
work correctly.
Is there anyone who use All-java JMF version with microphone without
problems?
_______________________________________________
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