Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
_headers/ULAW.h
/* |
File: ULAW.h |
Contains: Header containing the information needed to parse Sun's .au files. |
Written by: Mark Cookson |
Copyright: Copyright © 1996-1999 by Apple Computer, Inc., All Rights Reserved. |
You may incorporate this Apple sample source code into your program(s) without |
restriction. This Apple sample source code has been provided "AS IS" and the |
responsibility for its operation is yours. You are not permitted to redistribute |
this Apple sample source code as "Apple sample source code" after having made |
changes. If you're going to re-distribute the source, we require that you make |
it clear in the source that the code was descended from Apple sample source |
code, but that you've made changes. |
Change History (most recent first): |
8/31/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1 |
*/ |
#ifndef __ULAW__ |
#define __ULAW__ |
#include <Errors.h> |
#include <SoundComponents.h> |
#include <Types.h> |
#ifndef __DBFFERRORS__ |
#include "DBFF_Errors.h" |
#endif |
#ifndef __SETUPDBHEADER__ |
#include "SetupDBHeader.h" |
#endif |
#ifndef __LDANDFIX__ |
#include "LDandFix.h" |
#endif |
#ifndef __DEFINES__ |
#include "Defines.h" |
#endif |
/* data format possibilities */ |
#define SND_FORMAT_UNSPECIFIED 0 /* unspecified format (can't support this) */ |
#define SND_FORMAT_MULAW_8 1 /* 8-bit mu-law samples */ |
#define SND_FORMAT_LINEAR_8 2 /* 8-bit linear samples */ |
#define SND_FORMAT_LINEAR_16 3 /* 16-bit linear samples */ |
#define SND_FORMAT_LINEAR_24 4 /* 24-bit linear samples (can't support this) */ |
#define SND_FORMAT_LINEAR_32 5 /* 32-bit linear samples (can't support this) */ |
#define SND_FORMAT_FLOAT 6 /* floating-point samples (can't support this) */ |
#define SND_FORMAT_DOUBLE 7 /* double-precision float samples (can't support this) */ |
#define SND_FORMAT_INDIRECT 8 /* fragmented sampled data (can't support this) */ |
#define SND_FORMAT_NESTED 9 /* ? (can't support this) */ |
#define SND_FORMAT_DSP_CORE 10 /* DSP program (can't support this) */ |
#define SND_FORMAT_DSP_DATA_8 11 /* 8-bit fixed-point samples (can't support this) */ |
#define SND_FORMAT_DSP_DATA_16 12 /* 16-bit fixed-point samples (can't support this) */ |
#define SND_FORMAT_DSP_DATA_24 13 /* 24-bit fixed-point samples (can't support this) */ |
#define SND_FORMAT_DSP_DATA_32 14 /* 32-bit fixed-point samples (can't support this) */ |
#define SND_FORMAT_DISPLAY 16 /* non-audio display data (can't support this, it isn't playable data anyway) */ |
#define SND_FORMAT_MULAW_SQUELCH 17 /* ? (can't support this) */ |
#define SND_FORMAT_EMPHASIZED 18 /* 16-bit linear with emphasis (can't support this) */ |
#define SND_FORMAT_COMPRESSED 19 /* 16-bit linear with compression (can't support this) */ |
#define SND_FORMAT_COMPRESSED_EMPHASIZED 20 /* A combination of the two above (can't support this) */ |
#define SND_FORMAT_DSP_COMMANDS 21 /* Music Kit DSP commands (can't support this) */ |
#define SND_FORMAT_DSP_COMMANDS_SAMPLES 22 /* ? (can't support this) */ |
#if PRAGMA_ALIGN_SUPPORTED |
#pragma options align=mac68k |
#endif |
typedef struct auHeader { |
unsigned long id; /* Should be '.snd' */ |
unsigned long offsetToData; /* Offset into the file to where the data is */ |
unsigned long dataSize; /* Length of data */ |
unsigned long dataFormat; /* data format code */ |
unsigned long sampleRate; /* Samples per second */ |
unsigned long numChannels; /* 1 mono, 2 stereo */ |
unsigned char info[4]; /* optional text info */ |
}auHeader; |
#if PRAGMA_ALIGN_SUPPORTED |
#pragma options align=reset |
#endif |
OSErr ASoundGetULAWHeader (SoundInfoPtr theSoundInfo, |
long *dataStart, |
long *length); |
#define kULAWHeaderBufferSize 24 |
#endif |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-03-14