Having a hard time getting OpenAL to play any patch (using libpd). I was wondering if someone out there could help me out and explain what I'm doing wrong. I'm getting some output, but it's not the patch, it's just a repetitive buzz sound, which leads me to think that I'm doing something wrong per frame, rather than with initialization;
void update(double timeSinceLastFrame) {
pdBase->processFloat(1, inbuf, outbuf);
alBufferData(_bufferHandle, AL_FORMAT_STEREO16, outbuf, 128, srate);
alSourcei(_sourceHandle, AL_BUFFER, _bufferHandle);
alSourcePlay(_sourceHandle);
}
Is this the generally used method for getting OpenAL to play the output of a patch?
I'm not really familiar with OpenAL, but it looks to me like you have a sample format mismatch -- you're computing float samples with libpd, but you're telling OpenAL to expect short int samples. That would explain the sort of buzz you're hearing; I once almost fried my studio monitors that way. Try pbBase->processShort instead.
It looks like you're new here. If you want to get involved, click one of these buttons!