Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.monte.media.audio
Class PCMAudioCodec

    java.lang.Object
      org.monte.media.AbstractCodec
          org.monte.media.AbstractAudioCodec
              org.monte.media.audio.PCMAudioCodec

All Implemented Interfaces:
  Codec

Direct Known Subclasses:
  AVIPCMAudioCodec, QuickTimePCMAudioCodec

    public class PCMAudioCodec

extends AbstractAudioCodec

`PCMAudioCodec` performs sign conversion, endian conversion and quantization conversion of PCM audio data.

Does not perform sampling rate conversion or channel conversion.

FIXME Maybe create separate subclasses for AVI PCM and QuickTime PCM.

Version:
  $Id: PCMAudioCodec.java 155 2012-01-13 23:09:45Z werner $
Author:
  Werner Randelshofer

Field Summary

Fields inherited from class org.monte.media.AbstractCodec
`inputFormat, inputFormats, name, outputFormat, outputFormats`

Fields inherited from interface org.monte.media.Codec
`CODEC_FAILED, CODEC_INPUT_NOT_CONSUMED, CODEC_OK, CODEC_OUTPUT_NOT_FILLED`

Constructor Summary
`` | `PCMAudioCodec()`
`protected` | `PCMAudioCodec(Format[] supportedInputAndOutputFormats)`
`protected` | `PCMAudioCodec(Format[] supportedInputFormats, Format[] supportedOutputFormats)`

Method Summary
`int` | `process(Buffer in, Buffer out)` Performs the media processing defined by this codec.
`protected void` | `write16STo16U(javax.imageio.stream.ImageInputStream in, javax.imageio.stream.ImageOutputStream out)` 16-bit audio data signed in and unsigned out.
`protected void` | `write16STo8U(javax.imageio.stream.ImageInputStream in, javax.imageio.stream.ImageOutputStream out)` Signed 16-bit audio data in, unsigned 8-bit out.
`protected void` | `write16To16(javax.imageio.stream.ImageInputStream in, javax.imageio.stream.ImageOutputStream out)` 16-bit audio data in and out.
`protected void` | `write16UTo16S(javax.imageio.stream.ImageInputStream in, javax.imageio.stream.ImageOutputStream out)` 16-bit audio data unsigned in and signed out.
`protected void` | `write8STo8U(javax.imageio.stream.ImageInputStream in, javax.imageio.stream.ImageOutputStream out)` Signed 8-bit audio data in, unsigned out.
`protected void` | `write8To8(javax.imageio.stream.ImageInputStream in, javax.imageio.stream.ImageOutputStream out)` 8-bit audio data in and out.
`protected void` | `write8UTo8S(javax.imageio.stream.ImageInputStream in, javax.imageio.stream.ImageOutputStream out)` Unsigned 8-bit audio data in, signed out.

Methods inherited from class org.monte.media.AbstractCodec
`getInputFormat, getInputFormats, getName, getOutputFormat, getOutputFormats, reset, setInputFormat, setOutputFormat, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### PCMAudioCodec

    public PCMAudioCodec()

### PCMAudioCodec

    protected PCMAudioCodec(Format[] supportedInputFormats,
                            Format[] supportedOutputFormats)

### PCMAudioCodec

    protected PCMAudioCodec(Format[] supportedInputAndOutputFormats)

Method Detail

### process

    public int process(Buffer in,
                       Buffer out)

  Description copied from interface: `Codec`
  Performs the media processing defined by this codec.

  Copies the data from the input buffer into the output buffer.

  Returns:
    A combination of processing flags.

### write16To16

    protected void write16To16(javax.imageio.stream.ImageInputStream in,
                               javax.imageio.stream.ImageOutputStream out)
                        throws java.io.IOException

  16-bit audio data in and out. No sign conversion. Endian conversion is performed by the stream objects.

  Throws:
    `java.io.IOException`

### write16UTo16S

    protected void write16UTo16S(javax.imageio.stream.ImageInputStream in,
                                 javax.imageio.stream.ImageOutputStream out)
                          throws java.io.IOException

  16-bit audio data unsigned in and signed out. Endian conversion is performed by the stream objects.

  Throws:
    `java.io.IOException`

### write16STo16U

    protected void write16STo16U(javax.imageio.stream.ImageInputStream in,
                                 javax.imageio.stream.ImageOutputStream out)
                          throws java.io.IOException

  16-bit audio data signed in and unsigned out. Endian conversion is performed by the stream objects.

  Throws:
    `java.io.IOException`

### write16STo8U

    protected void write16STo8U(javax.imageio.stream.ImageInputStream in,
                                javax.imageio.stream.ImageOutputStream out)
                         throws java.io.IOException

  Signed 16-bit audio data in, unsigned 8-bit out. Endian conversion is performed by the stream objects.

  Throws:
    `java.io.IOException`

### write8To8

    protected void write8To8(javax.imageio.stream.ImageInputStream in,
                             javax.imageio.stream.ImageOutputStream out)
                      throws java.io.IOException

  8-bit audio data in and out. No sign conversion.

  Throws:
    `java.io.IOException`

### write8UTo8S

    protected void write8UTo8S(javax.imageio.stream.ImageInputStream in,
                               javax.imageio.stream.ImageOutputStream out)
                        throws java.io.IOException

  Unsigned 8-bit audio data in, signed out.

  Throws:
    `java.io.IOException`

### write8STo8U

    protected void write8STo8U(javax.imageio.stream.ImageInputStream in,
                               javax.imageio.stream.ImageOutputStream out)
                        throws java.io.IOException

  Signed 8-bit audio data in, unsigned out.

  Throws:
    `java.io.IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD