[speex-dev] JSpeex help
mail-box at nm.ru
mail-box at nm.ru
Fri Jun 22 01:21:09 PDT 2007
Hello,
I have a java applet which currently either captures audio in a
ByteArrayOutputStream or writes the capture as a PCM wave file.
I want to be able to encode the data using Speex, for playback and/or
saving for use later.
I've looked around the 'net and havent had much luck finding anywhere
for detailed information on integrating Jspeex into a Java application.
I'm using the following code to capture audio:
=======
// open line
line = (TargetDataLine)AudioSystem.getLine( dataLineInfo );
line.open( format );
line.start();
// write audio capture to buffer (ostream)
int buffSize = (int)format.getSampleRate() * format.getFrameSize();
byte buffer[] = new byte[buffSize];
ostream = new ByteArrayOutputStream();
while( state == 1 )
{
int count = line.read( buffer , 0 , buffer.length );
if( count > 0 )
ostream.write( buffer , 0 , count );
}
ostream.close();
========
Thank you in advance!
More information about the Speex-dev
mailing list