Encoding audio as ogg/speex

K

kamikazekoder

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.

can anybody help me with this? 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();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top