I’m using the latest version of FMOD Studio for UE4, and specifically the low-level functionality in C++.
I’m practically re-creating the user_created_sound.cpp example in a C++ class to test how everything works, and even though I can get a procedural sound playing like in the example, I’m running into problems cleaning up: When I call sound->release() my program crashes:
Exception thrown at 0x00007FFA0006E849 (ntdll.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
Does FMOD studio do the cleanup automatically for me? Should I not release the sound at all? Or is this a threading iussue?
Some more information:
- The sound is initialized like in the example, including FMOD_CREATESTREAM.
- I’m using FMOD in a subclass of UActorComponent, saving a pointer to the FMOD::Studio::System in BeginPlay(), and creating a FMOD::Sound just like in the user_created_sound.cpp example, except I’m not creating the low-level system but retrieving it from FMOD::Studio::System using getLowLevelSystem().
- I noticed that calling sound->GetOpenState() returns FMOD_OPENSTATE_PLAYING during playback, and FMOD_OPENSTATE_READY during the destructor where I call sound->release, while I never explicitly stopped the sound!
Any help would be much appreciated! Thanks!