Re: alcCaptureSamples crashes on stereo capturing

Philipp Kraus <[email protected]> Fri, 10 Aug 2012 11:39:37 +0200
Newsgroups gmane.comp.lib.openal
Message-ID <[email protected]>
On 2012-08-10 11:06:33 +0200, Chris Robinson said:

> On 08/10/2012 01:35 AM, Philipp Kraus wrote:
>> Yes, my code shows exactly;
> 
>  > if (l_samplesread > 0)
>  > {
>  >     l_samplesread = std::min(static_cast<std::size_t>(l_samplesread),
>  >                              l_buffer.size()-i);
>  >     alcCaptureSamples(m_device, (ALCvoid*)(&l_buffer(i)),
>  >                       l_samplesread);
>  >     i += l_samplesread;
>  > }
> 
> The problem here is that the count you're getting from and passing to 
> OpenAL is in sample frames. 1 sample frame for 8-bit stereo is 2 bytes.

Ah okay, that is / was my mistake. I have read the "sample read" 
exactly samples not "sample frames".

Thx

Phil


_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal