24 typedef uint8_t SampleType;
26 const SampleType SAMPLE_TYPE_NONE = 0;
28 const SampleType SAMPLE_TYPE_FILE = 1;
30 const SampleType SAMPLE_TYPE_MEM = 2;
37 AudioSample (
const uint8_t *source, uint32_t length, uint16_t channels, uint32_t sr, uint16_t bps);
41 void SetDataPosition (uint32_t newPosition);
42 uint32_t GetDataPosition (
void)
const;
43 uint32_t GetDataLength (
void)
const;
44 int GetData (
int frameCount, uint8_t *buffer);
45 void ClearSample (
void);
46 bool FillSilence (uint32_t time);
49 bool ToPlayer (player_audio_wav_t *dest);
50 bool FromPlayer (
const player_audio_wav_t *source);
53 bool LoadFile (
const char *fileName);
54 void CloseFile (
void);
55 const char* GetFilePath (
void)
const {
return filePath; }
58 SampleType GetType (
void)
const {
return type; }
59 void SetType (SampleType val) { type = val; }
60 uint16_t GetNumChannels (
void)
const {
return numChannels; }
61 void SetNumChannels (uint16_t val) { numChannels = val; }
62 uint32_t GetSampleRate (
void)
const {
return sampleRate; }
63 void SetSampleRate (uint32_t val) { sampleRate = val; byteRate = blockAlign * sampleRate; }
64 uint32_t GetByteRate (
void)
const {
return byteRate; }
65 uint16_t GetBlockAlign (
void)
const {
return blockAlign; }
66 void SetBlockAlign (uint16_t val) { blockAlign = val; byteRate = blockAlign * sampleRate; }
67 uint16_t GetBitsPerSample (
void)
const {
return bitsPerSample; }
68 void SetBitsPerSample (uint16_t val) { bitsPerSample = val; }
69 uint32_t GetNumFrames (
void)
const {
return numFrames; }
74 void PrintWaveInfo (
void);
84 uint16_t bitsPerSample;
#define PLAYER_WARN1(msg, a)
Error message macros.
Definition: error.h:90
Definition: pf_vector.h:42
static bool MatchMessage(player_msghdr_t *hdr, int type, int subtype, player_devaddr_t addr)
Helper for message processing.
Definition: message.h:159
double ReadFloat(int section, const char *name, double value)
Read a floating point (double) value.
An angle in 3D space.
Definition: player.h:207
Generic message header.
Definition: player.h:162
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: driver.h:658
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: driver.h:664
uint8_t type
Message type; must be one of PLAYER_MSGTYPE_*.
Definition: player.h:166
const char * ReadString(int section, const char *name, const char *value)
Read a string value.
A point in 3D space.
Definition: player.h:195
virtual void Main(void)=0
Main method for driver thread.
double ReadAngle(int section, const char *name, double value)
Read an angle (includes unit conversion).
const char * ReadTupleString(int section, const char *name, int index, const char *value)
Read a string from a tuple field.
#define PLAYER_MAX_MESSAGE_SIZE
The largest possible message.
Definition: player.h:68
int ReadInt(int section, const char *name, int value)
Read an integer value.
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:95
#define PLAYER_ERROR2(msg, a, b)
Error message macros.
Definition: error.h:83
virtual void Update()
Update non-threaded drivers.
Definition: driver.h:423
#define PLAYER_MSGTYPE_RESP_ACK
A positive response message.
Definition: player.h:112
Definition: audio_sample.h:33
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:106
#define PLAYER_MSGTYPE_RESP_NACK
A negative response message.
Definition: player.h:125
Definition: imagebase.h:62
Class for loading configuration file information.
Definition: configfile.h:197
virtual int Setup()
Initialize the driver.
Definition: driver.h:386
An autopointer for the message queue.
Definition: message.h:74
#define PLAYER_ERROR1(msg, a)
Error message macros.
Definition: error.h:82
#define PLAYER_ERROR(msg)
Error message macros.
Definition: error.h:81
Base class for drivers which oeprate with a thread.
Definition: driver.h:553
uint32_t size
Size in bytes of the payload to follow.
Definition: player.h:174
#define PLAYER_WARN(msg)
Warning message macros.
Definition: error.h:89
#define PLAYER_MSGTYPE_CMD
A command message.
Definition: player.h:99
Definition: localization/amcl/map/map.h:52
virtual int Shutdown()
Finalize the driver.
Definition: driver.h:393
Base class for all drivers.
Definition: driver.h:109
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:76