0

I'd like to have a C++ vector (or NSMutableDictionary) of sounds, so the user can record N things and play them back.

However when I try to create a new FMOD::Sound I get told its constructor is private - in the Sound class definition it states:

Constructor made private so user cannot statically instance a Sound class. Appropriate Sound creation or retrieval function must be used.

So how do I dynamically create a new sound object? There's a createSound method in system, but it requires an existing Sound object reference to be passed in to it:

FMOD_RESULT createSound (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);

Tomh
  • 332
  • 3
  • 7

1 Answers1

0

Thanks to πάντα ῥεῖ for the answer to this. You just have to create a null pointer of type Sound and then call createSound(...) with that:

Sound* newSound = nullptr;
createSound (..., &newSound);
Tomh
  • 332
  • 3
  • 7