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

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,187
Latest member
RosaDemko

Latest Threads

Top