search for: speexencode

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

Did you mean: speex_encode
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.Audio...
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 - samp...
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.getProcessedDataByteSi...
2010 May 06
1
Encoding a wave file with a bad header
If I use Speex, 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(),
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 l...
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(dec...
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(); Run...
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
I'm having difficulty encoding audio using the JSpeex Speex Encoder. My program throws an "Unsupported conversion" exception and I can't figure out why. I've read the related posts and I think I'm doing everything that was recommended. I'm working on Linux, by the way. Any help would be greatly appreciated. Richard Here is my program output: $ java -classpath
2008 Jan 08
0
JSpeex - Unsupported conversion
This is best answered by the jspeex folks, as it is the interfacing code that you are having problems with. That being said, it looks like, just as it says, you have asked for a conversion it cannot do -- you want it to convert PCM data to speex data at 44.1kHz sample rate -- speex only supports 8kHz in standard operation. It can also support 16kHz (wb) and 32kHz (uwb), but nothing outside of
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, //
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 pcm16bit...
2010 Mar 20
0
Decode file written from JSpeex using C/C++ API?
I'm new to Speex and I'm trying to compress audio using JSpeex in a servlet then play it back on the iPhone. I've managed to get Speex to compile on the iPhone by copying the speex and libspeex folders into XCode. I've read the sample code and the PDF documentation and I have a rough idea how to decode a raw stream. (I'm assuming the sampledec source works with raw speex audio
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: *"Insuff...
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 t...