libspatialaudio icon indicating copy to clipboard operation
libspatialaudio copied to clipboard

Bugs in example code

Open nblei opened this issue 4 years ago • 0 comments

A number of bugs exist in the sample code which cause runtime errors (segfault on my system).

The first is that CBFormat myFormat must be configured. I used myBFormat.Configure(1, true, 512).

Next is an error in the comments. The ambisonic encoder is also 1st order, not third order.

The second error is in the the configuration of CAmbisonicDecoder myDecoder. myDecoder.Configure(1, true, kAmblib_50, 5) is missing an argument for nBlockSize. The function signature is: bool Configure(unsigned int nOrder, bool b3D, unsigned int nBlockSize, int nSpeakerSetUp, unsigned int nSpeakers = 0).

I would also recommend changing enumerated types into enum classes, providing type safety, rather than using ints.

nblei avatar Jan 12 '21 18:01 nblei