videolabs / libspatialaudio

Ambisonic encoding / decoding and binauralization library in C++
Other
192 stars 37 forks source link

Bugs in example code #27

Open nblei opened 3 years ago

nblei commented 3 years ago

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.