libcw/cwAudioDeviceDecls.h
kpl 5cda838a93 Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules.
Other minor changes to prepare for integration into cwIo.
In cwMidi* replaced 'byte_t' with 'uint8_t'.
In cwAudioDevice* removed redundant 'device' prefix from function names.
2020-03-23 10:41:28 -04:00

37 lines
1.2 KiB
C++

#ifndef cwAudioDeviceDefs_H
#define cwAudioDeviceDefs_H
namespace cw
{
namespace audio
{
namespace device
{
typedef float sample_t;
// audioPacket_t flags
enum
{
kInterleavedApFl = 0x01, // The audio samples are interleaved.
kFloatApFl = 0x02 // The audio samples are single precision floating point values.
};
// Audio packet record used by the audioPacket_t callback.
// Audio ports send and receive audio using this data structure.
typedef struct
{
unsigned devIdx; // device associated with packet
unsigned begChIdx; // first device channel
unsigned chCnt; // count of channels
unsigned audioFramesCnt; // samples per channel (see note below)
unsigned bitsPerSample; // bits per sample word
unsigned flags; // kInterleavedApFl | kFloatApFl
void* audioBytesPtr; // pointer to sample data
void* cbArg; // user defined argument passed in via deviceSetup()
time::spec_t timeStamp; // Packet time stamp.
} audioPacket_t;
}
}
}
#endif