snapcast/chunk.h
(no author) f72c213407 chunks have shorts
git-svn-id: svn://elaine/murooma/trunk@56 d8a302eb-03bc-478d-80e4-98257eca68ef
2014-07-03 19:11:30 +00:00

30 lines
553 B
C++

#ifndef CHUNK_H
#define CHUNK_H
#define SAMPLE_RATE (48000)
//#define SAMPLE_BIT (16)
#define CHANNELS (2)
#define WIRE_CHUNK_MS (40)
#define WIRE_CHUNK_SIZE (SAMPLE_RATE*CHANNELS*WIRE_CHUNK_MS/1000)
#define PLAYER_CHUNK_MS (10)
#define PLAYER_CHUNK_SIZE (SAMPLE_RATE*CHANNELS*PLAYER_CHUNK_MS/1000)
#define FRAMES_PER_BUFFER (PLAYER_CHUNK_SIZE/CHANNELS)
template <size_t T>
struct ChunkT
{
int32_t tv_sec;
int32_t tv_usec;
int16_t payload[T];
};
typedef ChunkT<WIRE_CHUNK_SIZE> Chunk;
typedef ChunkT<PLAYER_CHUNK_SIZE> PlayerChunk;
#endif