search for: speexencod

Displaying 16 results from an estimated 16 matches for "speexencod".

Did you mean: speexencode
2006 Jul 18
1
SpeexEncoder requires 320 samples to process a Frame, not 160
Hi guys I have tried compiling this attached code, I made all the buffers 320, there is no trace of a 160 buffer, but I get a " SpeexEncoder requires 320 samples to process a Frame, not 160" error. Maybe there's something I'm missing, here's my code: import java.io.IOException; import java.io.FileOutputStream; import java.io.File; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.Audi...
2007 Aug 24
0
speex DTX chore
...should be send. i test it this way: pass 2 frames of 20ms with zeros to the encoder, pass 2 frames with rand numbers[white noise as far as i know] and finally use file with voice and silence mixed. all cases it returns 1. please look at the code and point me something i miss or mistake: [code] // SpeexEncoder.cpp #include "SpeexEncoder.h" #include <stdlib.h> #include <stdio.h> #include <windows.h> // // ======== Constructor ======== // // FUNCTION: initializes encoder with narrow or wide band // according to sampling frequency // // PARAMETERS: // - fs - sam...
2004 Aug 06
2
optimization possible?
hi, i did some tests about performance in jspeex ... uls@mainframe:~/eclipse/avrelay$ java TestClient Diff1: 0 10 Diff2: 141 started. uls@mainframe:~/eclipse/avrelay$ <p>{ SpeexEncoder e1=new SpeexEncoder(); e1.init(0,1,44100,1); byte[] by1=new byte[320]; long l1=System.currentTimeMillis(); long l2=System.currentTimeMillis(); System.out.println("Diff1: "+(l2-l1)); e1.processData(by1,0,by1.length); System.out.println(e1.getProcessedDataByteS...
2010 May 06
1
Encoding a wave file with a bad header
...JSpeex actually, to compress an otherwise valid wave file with zero lengths in the header would it impact the compression at all? Here's what I'm doing during compression in Java: AudioFormat wavFormat = ais.getFormat(); AudioFormat speexFormat = new AudioFormat(SpeexEncoding.SPEEX_Q5, wavFormat.getSampleRate(), -1, // sample size in bits wavFormat.getChannels(), -1, // frame size -1, // frame rate false); // little endian...
2004 Aug 06
0
JSpeex help
...length]; 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...
2004 Aug 06
0
Invalid mode encountered: corrupted stream?
...;enc_bitrate); speex_encoder_ctl(enc_state,SPEEX_SET_DTX, &vero); <p> //DECODER speex_bits_init(&dec_bits); dec_state = speex_decoder_init(&speex_nb_mode); speex_decoder_ctl(dec_state, SPEEX_RESET_STATE,NULL); speex_decoder_ctl(dec_state, SPEEX_SET_ENH, &falso); } void SpeexEncode(short *samples, char *encoded) { speex_bits_reset(&enc_bits); speex_encode(enc_state, samples, &enc_bits); enc_nbBytes = speex_bits_write(&enc_bits, encoded, 20); } void SpeexDecode(char *encoded, short *sample) { speex_bits_read_from(&dec_bits, encoded, 20); speex_decode(de...
2007 Aug 21
0
Need help on making speex AEC to work
...r r = new PcmRecorder(); final PcmPlayer p = new PcmPlayer(); r.setListener(new RecorderListener() { public void recorded(Object source, byte[] bytes, int length) { // WHEN A FRAME IS CAPTURED, THIS CALLBACK WILL BE TRIGGERED int c = speexEncode(bytes); // this is just for local playback, a demo only speexDecode(bytes, c); p.write(bytes, 0, length); // THIS IS WHERE A FRAME WAS WRITTEN FOR PLAYBACK } }); p.start(); r.start(); Ru...
2007 Nov 14
0
Audio glitches/Configuration problem !!?
...Speex DirectShow fitlers for VoIP following the documentation and sample code's. I am facing audio glitches when encoding - decoding PCM data. The encoder and decoder procedures are copied below. What about the lookahead size ? how shouw we apply it in encoding stage ? thanks in advance bool SpeexEncoder::EncodeData(char * inBuffer, int inSize, char * outBuffer, int outMAXSize, int* outSize) { if(!m_Initialized) return false; // Copy data into the local buffer memcpy(m_pBuffer + m_BufferSize, inBuffer, inSize); m_BufferSize += inSize; // check if we have enougth data for the...
2007 Nov 20
0
speex_bits_write / speex_bits_read_from - getting Static
...le SpeexBits struct and my decode function to accept a SpeexBits struct, it plays the vocoded audio without any problem. ****************** Managed C++ Code *********************************** //Public function -- m_encoderState is a void* member, m_bits is a SpeexBits* member array<Byte>^ SpeexEncoder::Encode(array<short>^ inputFrame) { //begin lazy man's way of converting to regular C unsigned int numSamples = inputFrame->Length; short* inputptr = (short*) malloc(numSamples*sizeof(short)); unsigned int i = 0; for(i = 0; i<numSamples; i++) inputptr[i...
2008 Jan 07
0
JSpeex - Unsupported conversion
...catch (Exception e) { System.out.println("Exception: " + e.getMessage()); e.printStackTrace(); return; } AudioFormat srcFormat = audioInputStream.getFormat(); AudioFormat targetFormat = new AudioFormat(SpeexEncoding.SPEEX_Q3, srcFormat.getSampleRate(), -1, // sample size in bits srcFormat.getChannels(), -1, // frame size -1, // frame rate...
2008 Jan 08
0
JSpeex - Unsupported conversion
...) { > System.out.println("Exception: " + e.getMessage()); > e.printStackTrace (); > return; > } > AudioFormat srcFormat = audioInputStream.getFormat(); > > AudioFormat targetFormat = > new AudioFormat(SpeexEncoding.SPEEX_Q3 , > srcFormat.getSampleRate(), > -1, // sample size in bits > srcFormat.getChannels(), > -1, // frame size > -1, // frame rate >...
2008 Dec 17
0
help with jspeex
hello i use the java lib jspeex from http://jspeex.sourceforge.net/ now i use this java code to encode to speex audioInputStream = AudioSystem.getAudioInputStream(srcFile); AudioFormat srcFormat = audioInputStream.getFormat(); AudioFormat targetFormat = new AudioFormat(SpeexEncoding.SPEEX_VBR8 , srcFormat.getSampleRate(), -1, // sample size in bits srcFormat.getChannels(), -1, // frame size -1, // frame rate srcFormat...
2009 Aug 05
0
endianess
...16bits data to speex, so i can then publish it to a flash client. On rtmp spec is said that is used network byte order, so in a speex frame consisted in more than 1 byte, i guess i have to send it in big endian order. By the source code of jspeex i see that when i pass pcm data as a parameter to SpeexEncoder.processData they use it as little endian and convert it to a float[] and only then the data is encoded to a byte[] of speex samples. I'm only getting noise on the flash client side, and i though it could be an endianess problem, doesn anyone have any suggetion? I'm recording the pcm16bi...
2010 Mar 20
0
Decode file written from JSpeex using C/C++ API?
...s.) I've also managed to compress a wave file and output a .spx file using JSpeex and the following Groovy code: AudioInputStream ais = AudioSystem.getAudioInputStream(new File("16Bitprompt.wav")); AudioFormat wavFormat = ais.getFormat(); AudioFormat speexFormat = new AudioFormat(SpeexEncoding.SPEEX_Q5, wavFormat.getSampleRate(), -1, // sample size in bits wavFormat.getChannels(), -1, // frame size -1, // frame rate false); // little endian ais = AudioSystem.getAudioInputStream(speexFormat,...
2010 Aug 27
0
Question about encoding
...At this point, the progrm can capture the voice from the microphone to an "ByteArrayOutputStream" object and play it back. I`m willing to add the encode\decode features of Jspeex but I can't make it to work, I`m probably missing somethnig. The code (Part of it) : ----- speexEnc = new SpeexEncoder(); speexEnc.init(0, 5, 8000, 1); //narrrow-band, 5 quallity, 8khz, 1 channel speexEnc.processData(buff, 0, buff.length); // 0 - the offset --- buff is the byte array of the ByteArrayOutputStream (=the voice from the microphone). the exception I get from processData() method is: *"Insuf...
2004 Aug 06
0
JSpeex help
...ramelength];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...