Alexander Mashin
Alexander Mashin

Reputation: 711

Recording sound with OpenAL(C++). Buffer size

I have one problem with recording sound with OpenAL library. I read second answer on this question: Recording Audio with OpenAL . But I dont understand, how I can change buffer size. If I change SSIZE, and buffer size to, for example, 441, the program is crashing. If you know answer of this question, please explain me, how I can get 1 ms buffer with sampling rate 96000Hz. (96 elements in array, with 1 channel, 8bit). Please help me.

Added: I change this:

const int SRATE = 96000;
const int SSIZE = 96;

ALbyte buffer[SSIZE];
ALint sample;

and

AL_FORMAT_STEREO16

to

AL_FORMAT_MONO8

and this gave me this error: enter image description here

Upvotes: 2

Views: 753

Answers (1)

Goz
Goz

Reputation: 62333

I would guess that the number of samples returned by alcGetIntegerv is larger than SSIZE ...

Upvotes: 1

Related Questions