[speex-dev] JSpeex help

Sanjiv Desai sdesai at interactions.net
Thu Dec 4 09:31:50 PST 2003



I am not sure if this is right place to ask for help on jspeex or can some one suggest. I have tried on jspeex sourceforge.net page.

I am trying to use Pcm2SpeexAudioInputStream by creating it from tdl which received pcm_signed audio data as follows:
AudioFormat format = new AudioFormat (AudioFormat.Encoding.PCM_SIGNED, 8000, 16, 1, 2, 8000, true);
DataLine.Info targetInfo = new DataLine.Info (TargetDataLine.class, format, 8000);
TargetDataLine tdl = (TargetDataLine) AudioSystem.getLine (targetInfo);
AudioInputStream auin=new AudioInputStream (tdl);
PipedOutputStream pout=new PipedOutputStream();
PipedInputStream pin=new PipedInputStream(pout);
pcm2speex=new Pcm2SpeexAudioInputStream (pin, format, AudioSystem.NOT_SPECIFIED);
tdl.open(format,8000);
t.input.start();
double ratio = t.bufferlength / t.framelength; 
byte[] frame=new byte[t.framelength];
while(true) {
  int n=auin.read(frame, 0, frame.length);
  System.out.println(""+n+" bytes read.");
  pout.write(frame);
  int m=pcm2speex.read();
  System.out.println(""+m+" bytes read - 2.");
}

But, when I run, it waits in auin.read. I tried using speexEncoder to manually process data, but I get only noise as compressed data. It took about 200 ms to encode each frame. Also, I am wondering, if preprocessing setting like echo cancellation is possible with this version. How can I check for silence when vad and dtx turned on. Is it possible to control the length of silence before triggering dtx(end of speech)? Is next version with floating point to int conversion, AGC, denoiser etc and other features of speex 1.1.3, going to be released soon?

I will appreciate any help on sample code to do real-time encoding from targetDataLine.

I have tried java sound spi provided, and tried using SpeexFormatConvertionProvider, SpeexAudioFileWriter etc, but nothing seems to work. I know that its going to be some thing very simple, I am missing or not using properly.

Thanks.

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'speex-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Speex-dev mailing list