Encoding audio as ogg/speex

Discussion in 'Java' started by kamikazekoder, Jun 26, 2006.

  1. 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();
    kamikazekoder, Jun 26, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. maxwell hammer

    Python wrapper to ffmpeg and speex

    maxwell hammer, Jan 17, 2004, in forum: Python
    Replies:
    0
    Views:
    560
    maxwell hammer
    Jan 17, 2004
  2. maxwell hammer

    Wrapper to speex and ffmpeg library

    maxwell hammer, Jan 17, 2004, in forum: Python
    Replies:
    0
    Views:
    480
    maxwell hammer
    Jan 17, 2004
  3. aeonsun
    Replies:
    2
    Views:
    417
    Luc The Perverse
    Mar 11, 2007
  4. Replies:
    5
    Views:
    1,125
    stranjo
    Oct 8, 2010
  5. sick dick
    Replies:
    0
    Views:
    383
    sick dick
    Apr 3, 2006
Loading...

Share This Page