nariakiiwatani / ofxNDI

NewTek NDI SDK Wrapper for openFrameworks.
https://ndi.tv/
MIT License
103 stars 19 forks source link

FIxed audio send and received buffers config #10

Closed roymacdonald closed 5 years ago

roymacdonald commented 5 years ago

Hi, I found out that the addon was not handling multi channel audio in the correct way, so I made the fix in this PR. NDI uses planar sound buffers, this means that each channel is saved sequentially instead of OF which uses interleaved sound buffers. I've tested it and works as expected.

nariakiiwatani commented 5 years ago

Thank you! I didn't notice it.

I fixed a bit. In case of decoding to ofSoundBuffer of non-allocated or different settings.

roymacdonald commented 5 years ago

super. by the way, great addon. Thanks. What is that you fixed a bit?

nariakiiwatani commented 5 years ago

I fixed your code a bit to avoid possibly crash by adding ofSoundBuffer reallcation in AudioFrame::decode. Now it works if the buffer was not setup as AudioFrame expected.

nariakiiwatani commented 5 years ago

If empty(size()==0) buffer was passed, 'NDIlib_util_audio_to_interleaved_32f_v2(this, &interleaved_frame);' would write to non allocated memory.

roymacdonald commented 5 years ago

Oh, I see, sure. thanks for that.