alcCaptureSamples crashes on stereo capturing
Philipp Kraus <[email protected]> Thu, 9 Aug 2012 16:14:09 +0200
| Newsgroups | gmane.comp.lib.openal |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I have got this code for capturing mono 8 bit data, the code works
without any error:
m_device = alcCaptureOpenDevice( p_device.c_str(),
static_cast<ALCuint>(p_sampingfrequency), AL_FORMAT_MONO8,
static_cast<ALCsizei>(p_buffersize));
ublas::vector<ALubyte> l_buffer(m_buffersize);
alcCaptureStart(m_device);
while(m_capturing)
{
alcGetIntegerv(...)
l_samplesread = std::min(
static_cast<std::size_t>(l_samplesread), l_buffer.size()-i);
alcCaptureSamples(m_device, (ALCvoid*)(&l_buffer[i]), l_samplesread);
}
If I switch the the AL_FORMAT_MONO8 to AL_FORMAT_STEREO8 and change the
p_buffersize to 2*p_buffersize & m_buffersize to 2*m_buffersize the
code crashes
on the alcCaptureSamples line and the buffer is not filled. IMHO the
left channel should be the even elements in the l_buffer and the right
the odd ones, so if I create
a double size buffer each l_buffer block should be started with the
left channel data. If I disable the alcCaptureSample call, the correct
number of samples are received.
Can anybody help me please to create the correct stereo working option?
Thx
Phil
_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal