|
|
@ -30,8 +30,11 @@ static char tmp_buffer[BSIZE];
|
|
|
|
// Number of buffers used (per sound) for streaming sounds. Each
|
|
|
|
// Number of buffers used (per sound) for streaming sounds. Each
|
|
|
|
// buffer is of size BSIZE. Increasing this will make streaming sounds
|
|
|
|
// buffer is of size BSIZE. Increasing this will make streaming sounds
|
|
|
|
// more fault tolerant against temporary lapses in call to update(),
|
|
|
|
// more fault tolerant against temporary lapses in call to update(),
|
|
|
|
// but will also increase memory usage. 4 should be ok.
|
|
|
|
// but will also increase memory usage.
|
|
|
|
const int STREAM_BUF_NUM = 4;
|
|
|
|
// This was changed from 4 to 150 for an estimated 30 seconds tolerance.
|
|
|
|
|
|
|
|
// At some point we should replace it with a more multithreading-ish
|
|
|
|
|
|
|
|
// solution.
|
|
|
|
|
|
|
|
const int STREAM_BUF_NUM = 150;
|
|
|
|
|
|
|
|
|
|
|
|
static void fail(const std::string &msg)
|
|
|
|
static void fail(const std::string &msg)
|
|
|
|
{ throw std::runtime_error("OpenAL exception: " + msg); }
|
|
|
|
{ throw std::runtime_error("OpenAL exception: " + msg); }
|
|
|
@ -101,7 +104,7 @@ class Mangle::Sound::OpenAL_Sound : public Sound
|
|
|
|
ALuint inst;
|
|
|
|
ALuint inst;
|
|
|
|
|
|
|
|
|
|
|
|
// Buffers. Only the first is used for non-streaming sounds.
|
|
|
|
// Buffers. Only the first is used for non-streaming sounds.
|
|
|
|
ALuint bufferID[4];
|
|
|
|
ALuint bufferID[STREAM_BUF_NUM];
|
|
|
|
|
|
|
|
|
|
|
|
// Number of buffers used
|
|
|
|
// Number of buffers used
|
|
|
|
int bufNum;
|
|
|
|
int bufNum;
|
|
|
|