API Guide Home (Online version only) |

# PalmSoundMgrExt.h File Reference

## Detailed Description

Public 68K include file for the Extended Sound Manager.

Notes: You should check to see if you are using a version of Palm OS SDK that implements the Extended Sound API. For lack of a better check, look for the earlier of the system traps and hope that the rest is likewise defined.

The calling application should always load this library with SysLibLoad() before use, even if it is already open by another application(ie, SysLibFind() returns a valid refnum). When the application is done with the library, it should be unloaded with SysLibRemove(). We do this because there is no good way to synchronize loading and unloading of libraries among multiple applications. It also greatly simplifies internal synchronization.

Definition in file PalmSoundMgrExt.h.

Include dependency graph for PalmSoundMgrExt.h:

Go to the source code of this file.

## Defines

Extended Sound library traps

- #define sysTrapSndStreamCreateExtended 0xA466
- #define sysTrapSndStreamDeviceControl 0xA467

## Typedefs

- typedef UInt32 SndFormatType
- typedef Err(*) SndStreamVariableBufferCallback (void *userDataP, SndStreamRef streamRef, void *bufferP, UInt32 *bufferSizeP)

## Enumerations

- enum {
  sndFormatPCM = 0,
  sndFormatIMA_ADPCM = 'APCM',
  sndFormatDVI_ADPCM = 'DPCM',
  sndFormatMP3 = 'MPG3',
  sndFormatAAC = 'DAAC',
  sndFormatOGG = 'OGGV'
  }

## Functions

- Err SndStreamCreateExtended (SndStreamRef *streamP, SndStreamMode mode, SndFormatType format, UInt32 sampleRate, SndSampleType sampleType, SndStreamWidth width, SndStreamVariableBufferCallback sndCallback, void *userDataP, UInt32 bufferSize, Boolean armNative)
- Err SndStreamDeviceControl (SndStreamRef stream, Int32 cmd, void *paramP, Int32 size)

## Define Documentation

#define sysTrapSndStreamCreateExtended 0xA466

Definition at line 48 of file PalmSoundMgrExt.h.

#define sysTrapSndStreamDeviceControl 0xA467

Definition at line 52 of file PalmSoundMgrExt.h.

## Typedef Documentation

typedef UInt32 SndFormatType

Holds sound format type.

Definition at line 69 of file PalmSoundMgrExt.h.

typedef Err(*) SndStreamVariableBufferCallback(void *userDataP, SndStreamRef streamRef, void *bufferP, UInt32 *bufferSizeP)

Extended Sound Manager callback.

Parameters:

  | userDataP,: | IN: Pointer to the user data passed in SndStreamCreateExtended.
  | streamRef,: | IN: Opaque reference to the stream returned by SndStreamCreateExtended.
  | bufferP,: | IN: Data buffer.
  | bufferSizeP,: | IN: Pointer to the buffer size in bytes. This MUST be set before returning to the number of bytes read or written.

Return values:

  | Err | Error code.

Definition at line 79 of file PalmSoundMgrExt.h.

## Enumeration Type Documentation

anonymous enum

Sound format type

Enumerator:

  sndFormatPCM | Raw PCM (Pulse Code Modulation), (attributes defined by type parameter).
  sndFormatIMA_ADPCM | IMA ADPCM (Interactive Multimedia Association Adaptive Differential PCM).
  sndFormatDVI_ADPCM | Intel/MS/DVI ADPCM.
  sndFormatMP3 | Moving Picture Experts Group, Audio Layer III (MPEG-1 and MPEG-2 depending on bit-rate).
  sndFormatAAC | Dolby Advanced Audio Coding.
  sndFormatOGG | Ogg Vorbis.

Definition at line 59 of file PalmSoundMgrExt.h.

    00059      {
    00060     sndFormatPCM        = 0,            /**<Raw PCM (Pulse Code Modulation), (attributes defined by type parameter). */
    00061     sndFormatIMA_ADPCM  = 'APCM',       /**<IMA ADPCM (Interactive Multimedia Association Adaptive Differential PCM). */
    00062     sndFormatDVI_ADPCM  = 'DPCM',       /**<Intel/MS/DVI ADPCM. */
    00063     sndFormatMP3        = 'MPG3',       /**<Moving Picture Experts Group, Audio Layer III (MPEG-1 and MPEG-2 depending on bit-rate). */
    00064     sndFormatAAC        = 'DAAC',       /**<Dolby Advanced Audio Coding. */
    00065     sndFormatOGG        = 'OGGV'        /**<Ogg Vorbis. */
    00066 };

## Function Documentation

Err SndStreamCreateExtended | ( | SndStreamRef * | streamP,
|  | SndStreamMode | mode,
|  | SndFormatType | format,
|  | UInt32 | sampleRate,
|  | SndSampleType | sampleType,
|  | SndStreamWidth | width,
|  | SndStreamVariableBufferCallback | sndCallback,
|  | void * | userDataP,
|  | UInt32 | bufferSize,
|  | Boolean | armNative |
| ) |  |  |

Creates a sound stream using the Extended Sound API.

Parameters:

  | streamP,: | IN: Receives the opaque reference to the stream.
  | mode,: | IN: Direction of the sream, either sndInput or sndOutput.
  | format,: | IN: Sound format. (sndFormatPCM...)
  | sampleRate,: | IN: Sampling rate, in frames-per-second. (8000, 44100,...)
  | sampleType,: | IN: Sample size and endianness of the data. (sndInt16...)
  | width,: | IN: The number of channels: sndMono for one channel, sndStrereo for two.
  | sndCallback,: | IN: A callback function that gets called when another buffer for sound is needed.
  | userDataP,: | IN: Caller-defined data that gets passed to SndStreamVariableBufferCallback.
  | bufferSize,: | IN: Preferred size in bytes for the buffers that are passed to sndCallback.
  | armNative,: | IN: Pass true if the callback function is written in ARM-native code. If it’s 68K, pass false.

Return values:

  | Err | Error code.

Err SndStreamDeviceControl | ( | SndStreamRef | stream,
|  | Int32 | cmd,
|  | void * | paramP,
|  | Int32 | size |
| ) |  |  |

An extended function to handle new or device specific custom sound controls.

Parameters:

  | stream,: | IN: Opaque reference to the stream returned by SndStreamCreateExtended.
  | cmd,: | IN: One of the defined custom control enums, such as sndControlCodecCustomControl.
  | paramP,: | IN: Pointer to data specific to the specific custom control defined by cmd.
  | size,: | IN: Size in bytes of the structure passed in paramP.

Return values:

  | Err | Error code.

Top | Palm Developer Network © 2004-2008, Palm, Inc. All rights reserved. Generated on Fri Jun 13 10:07:57 2008 for Palm API Guide