[sip-comm-dev] SPEEX RTP encoder decoder


#1

I was trying to get the JavaEncoder/JavaDecoder for speex to work with FMJ as a custom RTP payload.

I noticed, looking at the code, that JavaEncoder requires an input of 16 bits per sample, and it will then output 16 bits per sample.

JavaDecoder, on the other hand, requires an input of 8 bits per sample, and it then outputs 8 bits per sample.

This means, in short, that the decoder is incompatible with the encoder.

Are these two classes actually known to work together?

Any help appreciated,

Ken Larson
FMJ project.

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hi Ken,

Have you managed to solve this problem? I took a quick look at this when I received this message (and to me, it looked as if JavaDecoder outputs 16bits samples), but I was short on time to investigate this further. Now that I'm on holidays I might help.

Chris.

···

----- Original Message -----

From: "Ken Larson" <oss@larsontechnologies.com>

To: <dev@sip-communicator.dev.java.net>
Sent: Thursday, June 14, 2007 1:54 PM
Subject: [sip-comm-dev] SPEEX RTP encoder decoder

I was trying to get the JavaEncoder/JavaDecoder for speex to work with FMJ as a custom RTP payload.

I noticed, looking at the code, that JavaEncoder requires an input of 16 bits per sample, and it will then output 16 bits per sample.

JavaDecoder, on the other hand, requires an input of 8 bits per sample, and it then outputs 8 bits per sample.

This means, in short, that the decoder is incompatible with the encoder.

Are these two classes actually known to work together?

Any help appreciated,

Ken Larson
FMJ project.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

I haven't tried very hard, but no, I haven't gotten it working.

Ken

Chris wrote:

···

Hi Ken,

Have you managed to solve this problem? I took a quick look at this when I received this message (and to me, it looked as if JavaDecoder outputs 16bits samples), but I was short on time to investigate this further. Now that I'm on holidays I might help.

Chris.

----- Original Message ----- From: "Ken Larson" <oss@larsontechnologies.com>
To: <dev@sip-communicator.dev.java.net>
Sent: Thursday, June 14, 2007 1:54 PM
Subject: [sip-comm-dev] SPEEX RTP encoder decoder

I was trying to get the JavaEncoder/JavaDecoder for speex to work with FMJ as a custom RTP payload.

I noticed, looking at the code, that JavaEncoder requires an input of 16 bits per sample, and it will then output 16 bits per sample.

JavaDecoder, on the other hand, requires an input of 8 bits per sample, and it then outputs 8 bits per sample.

This means, in short, that the decoder is incompatible with the encoder.

Are these two classes actually known to work together?

Any help appreciated,

Ken Larson
FMJ project.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Actually, I just got this to work. I have to make sure I register it with the RTPManager using 8 bits, not 16 bits. Decoded it is 16 bits, and encoded it is 8 bits.

Then I have to apply the following patch to JavaEncoder. Perhaps you could test and apply this patch to SIP communicator, thanks.

### Eclipse Workspace Patch 1.0
#P fmj
Index: src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java

···

===================================================================
RCS file: /cvsroot/fmj/fmj/src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java,v
retrieving revision 1.1
diff -u -r1.1 JavaEncoder.java
--- src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java 27 May 2007 20:43:36 -0000 1.1
+++ src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java 17 Jun 2007 09:35:25 -0000
@@ -54,7 +54,7 @@
             {new AudioFormat(
                 Constants.SPEEX_RTP,
                 af.getSampleRate(),
- af.getSampleSizeInBits(),
+ 8,
                 af.getChannels(),
                 af.getEndian(),
                 af.getSigned()

Chris wrote:

Hi Ken,

Have you managed to solve this problem? I took a quick look at this when I received this message (and to me, it looked as if JavaDecoder outputs 16bits samples), but I was short on time to investigate this further. Now that I'm on holidays I might help.

Chris.

----- Original Message ----- From: "Ken Larson" <oss@larsontechnologies.com>
To: <dev@sip-communicator.dev.java.net>
Sent: Thursday, June 14, 2007 1:54 PM
Subject: [sip-comm-dev] SPEEX RTP encoder decoder

I was trying to get the JavaEncoder/JavaDecoder for speex to work with FMJ as a custom RTP payload.

I noticed, looking at the code, that JavaEncoder requires an input of 16 bits per sample, and it will then output 16 bits per sample.

JavaDecoder, on the other hand, requires an input of 8 bits per sample, and it then outputs 8 bits per sample.

This means, in short, that the decoder is incompatible with the encoder.

Are these two classes actually known to work together?

Any help appreciated,

Ken Larson
FMJ project.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#5

Hi,

What is actually the problem I've tried the patch and cannot see any change in the audio, maybe it depends on jmf or fmj ?

damencho

Ken Larson wrote:

···

Actually, I just got this to work. I have to make sure I register it with the RTPManager using 8 bits, not 16 bits. Decoded it is 16 bits, and encoded it is 8 bits.

Then I have to apply the following patch to JavaEncoder. Perhaps you could test and apply this patch to SIP communicator, thanks.

### Eclipse Workspace Patch 1.0
#P fmj
Index: src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java

===================================================================
RCS file: /cvsroot/fmj/fmj/src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java,v

retrieving revision 1.1
diff -u -r1.1 JavaEncoder.java
--- src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java 27 May 2007 20:43:36 -0000 1.1
+++ src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java 17 Jun 2007 09:35:25 -0000
@@ -54,7 +54,7 @@
            {new AudioFormat(
                Constants.SPEEX_RTP,
                af.getSampleRate(),
- af.getSampleSizeInBits(),
+ 8,
                af.getChannels(),
                af.getEndian(),
                af.getSigned()

Chris wrote:

Hi Ken,

Have you managed to solve this problem? I took a quick look at this when I received this message (and to me, it looked as if JavaDecoder outputs 16bits samples), but I was short on time to investigate this further. Now that I'm on holidays I might help.

Chris.

----- Original Message ----- From: "Ken Larson" <oss@larsontechnologies.com>
To: <dev@sip-communicator.dev.java.net>
Sent: Thursday, June 14, 2007 1:54 PM
Subject: [sip-comm-dev] SPEEX RTP encoder decoder

I was trying to get the JavaEncoder/JavaDecoder for speex to work with FMJ as a custom RTP payload.

I noticed, looking at the code, that JavaEncoder requires an input of 16 bits per sample, and it will then output 16 bits per sample.

JavaDecoder, on the other hand, requires an input of 8 bits per sample, and it then outputs 8 bits per sample.

This means, in short, that the decoder is incompatible with the encoder.

Are these two classes actually known to work together?

Any help appreciated,

Ken Larson
FMJ project.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#6

Damian -

Try it using a 16 bit audio source, and you may see the problem with JMF. If the input to the encoder is 16 bit, the encoder claims that the output will be 16 bit, when the output will in fact be 8 bit.

Now, if you have registered the codec with the RTPManager as having an 8-bit output (which it does have), the formats won't match, and a filter graph can't be built. If you lie and register it as having an 8-bit output, it may actually work.

Do you have some sample code that you use to test this with JMF? That might help me explain it if my above description is not sufficient.

Thanks,

Ken

Damian Minkov wrote:

···

Hi,

What is actually the problem I've tried the patch and cannot see any change in the audio, maybe it depends on jmf or fmj ?

damencho

Ken Larson wrote:

Actually, I just got this to work. I have to make sure I register it with the RTPManager using 8 bits, not 16 bits. Decoded it is 16 bits, and encoded it is 8 bits.

Then I have to apply the following patch to JavaEncoder. Perhaps you could test and apply this patch to SIP communicator, thanks.

### Eclipse Workspace Patch 1.0
#P fmj
Index: src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java

===================================================================
RCS file: /cvsroot/fmj/fmj/src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java,v

retrieving revision 1.1
diff -u -r1.1 JavaEncoder.java
--- src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java 27 May 2007 20:43:36 -0000 1.1
+++ src.sip-communicator/net/java/sip/communicator/impl/media/codec/audio/speex/JavaEncoder.java 17 Jun 2007 09:35:25 -0000
@@ -54,7 +54,7 @@
            {new AudioFormat(
                Constants.SPEEX_RTP,
                af.getSampleRate(),
- af.getSampleSizeInBits(),
+ 8,
                af.getChannels(),
                af.getEndian(),
                af.getSigned()

Chris wrote:

Hi Ken,

Have you managed to solve this problem? I took a quick look at this when I received this message (and to me, it looked as if JavaDecoder outputs 16bits samples), but I was short on time to investigate this further. Now that I'm on holidays I might help.

Chris.

----- Original Message ----- From: "Ken Larson" <oss@larsontechnologies.com>
To: <dev@sip-communicator.dev.java.net>
Sent: Thursday, June 14, 2007 1:54 PM
Subject: [sip-comm-dev] SPEEX RTP encoder decoder

I was trying to get the JavaEncoder/JavaDecoder for speex to work with FMJ as a custom RTP payload.

I noticed, looking at the code, that JavaEncoder requires an input of 16 bits per sample, and it will then output 16 bits per sample.

JavaDecoder, on the other hand, requires an input of 8 bits per sample, and it then outputs 8 bits per sample.

This means, in short, that the decoder is incompatible with the encoder.

Are these two classes actually known to work together?

Any help appreciated,

Ken Larson
FMJ project.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net