MMA_StreamPosFrames

[GQ], UQUAD*. (V51)

DESCRIPTION

   Returns current absolute stream position in sample frames. It is exactly
   the number of the whole sample frames pulled from object's output

NOTES

   This is a 64-bit attribute passed by pointer to UQUAD variable, not by
   value.

MMA_StreamPosTime

[GQ], UQUAD*. (V51)

DESCRIPTION

   Returns absolute stream time position in microseconds. This time position
   is strictly based on stream sample rate, and reflects only the whole
   sample frames already pulled from the object output. The exact formula
   is:

   time_pos = whole_frames_pulled / sample_rate

NOTES

   This is a 64-bit attribute passed by pointer to UQUAD variable, not by
   value.

MMM_Pull

gets block of decoded audio data from object. (V50)

SYNOPSIS

   ULONG DoMethod(Object *obj, MMM_Pull, ULONG port, APTR buffer, ULONG
   length);

DESCRIPTION

   Places required amount of decoded audio data in specified buffer. Note
   that requested number of bytes should be a multiply of sample frame size
   (for example 8 bytes for stereo sound if MMFC_INT32 is set as output
   format). If it is not, it will be rounded down to the nearest sample
   frame boundary, left bytes are undefined

INPUTS

   - port - number of port is always 1 (the output port).
   - buffer - memory buffer for pulled data, must be aligned to 16-byte
     boundary (preferrably allocated with MediaAllocVec()).
   - length - amount of pulled data in bytes. Will be rounded down to the
     nearest sample frame boundary

RESULT

   Number of bytes pulled. If less than requested, check MMA_ErrorCode

MMM_Seek

moves current position in audio stream. (V50)

SYNOPSIS

   BOOL DoMethod(Object *obj, MMM_Seek, ULONG port, ULONG type, QUAD *pos);

DESCRIPTION

   For time seek converts requested time position to frame number. Then for
   both frame or time seek converts frame number to byte position in encoded
   stream and passes seek request to previous object

INPUTS

   - port - number of port is always 1 (the output port).
   - type - seek type, either MMM_SEEK_FRAMES or MMM_SEEK_TIME.
   - pos - 64-bit position, either frame number or time in microseconds

RESULT

   Boolean value of success. In case of failure, check MMA_ErrorCode

__background__

HISTORY

  51.4  (04.04.2007)
  - Rewritten MMM_Seek(), added time to frame conversion and frame to
    byte conversion. All time and frame seeks are now converted to byte
    seeks (relative to the 'data' WAVE stream chunk). Seeking in 6 and
    7 WAVE subformats is now fully functional.

  51.3  (03.04.2007)
  - Added error forwarding in MMM_Pull().

  51.2  (17.11.2005)
  - Fixed serious bug in MuLawToFloat32(), sound was distorted horribly.

  51.1  (05.06.2005)
  - Initial release.

DESCRIPTION

  This class is a Reggae decoder for decoding non-linearly quantized 8-bit
  PCM data according to two CCITT standards: mu-law and A-law. These
  nonlinear quantizations are used for example in WAVE format as subtypes 6
  and 7. Nonlinear quantization improves subjective signal to noise ratio
  compared to linear 8-bit PCM coding. A laws.decoder object has one input
  (port 0) and one output (port 1). The input accepts following formats (all
  formats are with interleaved channels):

  - MMF_AUDIO_MULAW, 8-bit unsigned integers, mu-law quantization curve.
  - MMF_AUDIO_ALAW, 8-bit unsigned integers, A-law quantization curve.

  On the output an object can produce following formats:

  - MMFC_AUDIO_INT16, 16-bit signed interegs,
  - MMFC_AUDIO_INT32, 32-bit signed integers,
  - MMFC_AUDIO_FLOAT32, 32-bit single precision floats, normalized to
    (-1.0, +1.0) range.

NEW ATTRIBUTES

   Attributes applicability:
     I - may be set at creation time.
     S - may be set on an existing object.
     G - may be get from an object.
     P - may be set for an object's port.
     Q - may be queried from an object's port.

   MMA_StreamPosFrames      (V51) [..G.Q], UQUAD*
   MMA_StreamPosTime        (V51) [..G.Q], UQUAD*

NEW METHODS

   MMM_Pull(port, buffer, length)  (V50)