Interface Mp3Encoder


public interface Mp3Encoder
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the encoder and flushes the output stream.
    void
    encode(short[] samples)
    Encodes the given PCM samples and writes it to the provided output stream.
  • Method Details

    • encode

      void encode(short[] samples) throws IOException
      Encodes the given PCM samples and writes it to the provided output stream.
      Parameters:
      samples - the PCM samples to encode
      Throws:
      IOException - if an I/O error occurs
    • close

      void close() throws IOException
      Closes the encoder and flushes the output stream. Also writes leftover mp3 data to the output stream. NOTE: Not closing encoders will cause a memory leak!
      Throws:
      IOException - if an I/O error occurs