In my case I have a method where it determines the correct file to play based on parameters, then plays the audio file. However, when I run setSource a second time it seems to fail. Is there something that I’m doing wrong? If so please suggest alternatives to resolve my issue.
As it says in the thread that I linked, it seems to throw a EXC_BAD_ACCESS error when it tries to run the “releaseResource()” method, That is where I traced the issue to as well:
"All I could understand is that it seems like it fails to find an AudioSource to delete at some point in the setSource method, in juce_ResamplingAudioSource.cpp at:
Thank you so much that was exactly what I needed. I fixed my issue with the statement transportSource.setSource(nullptr); before I added a new scoped pointer.