2022-05-19 01:51:26 -07:00
|
|
|
#ifndef AUDIO_FILE_H
|
|
|
|
#define AUDIO_FILE_H
|
|
|
|
|
|
|
|
#include "sound_decoder.h"
|
|
|
|
|
2022-09-23 05:43:44 -07:00
|
|
|
namespace fallout {
|
|
|
|
|
2022-05-19 01:51:26 -07:00
|
|
|
typedef enum AudioFileFlags {
|
|
|
|
AUDIO_FILE_IN_USE = 0x01,
|
|
|
|
AUDIO_FILE_COMPRESSED = 0x02,
|
|
|
|
} AudioFileFlags;
|
|
|
|
|
|
|
|
typedef struct AudioFile {
|
|
|
|
int flags;
|
|
|
|
int fileHandle;
|
|
|
|
SoundDecoder* soundDecoder;
|
|
|
|
int fileSize;
|
2022-12-25 11:30:31 -08:00
|
|
|
int sampleRate;
|
|
|
|
int channels;
|
2022-05-19 01:51:26 -07:00
|
|
|
int position;
|
|
|
|
} AudioFile;
|
|
|
|
|
|
|
|
typedef bool(AudioFileIsCompressedProc)(char* filePath);
|
|
|
|
|
|
|
|
int audioFileOpen(const char* fname, int flags, ...);
|
|
|
|
int audioFileClose(int a1);
|
|
|
|
int audioFileRead(int a1, void* buf, unsigned int size);
|
2022-05-21 08:22:03 -07:00
|
|
|
long audioFileSeek(int handle, long offset, int origin);
|
2022-05-19 01:51:26 -07:00
|
|
|
long audioFileGetSize(int a1);
|
|
|
|
long audioFileTell(int a1);
|
|
|
|
int audioFileWrite(int handle, const void* buf, unsigned int size);
|
|
|
|
int audioFileInit(AudioFileIsCompressedProc* isCompressedProc);
|
|
|
|
void audioFileExit();
|
|
|
|
|
2022-09-23 05:43:44 -07:00
|
|
|
} // namespace fallout
|
|
|
|
|
2022-05-19 01:51:26 -07:00
|
|
|
#endif /* AUDIO_FILE_H */
|