i have an audioplayer - it plays fine.
But I want it to loop. but the setLooping() method doesn’t seem to work
any guidance
void playAudio()
{
auto* reader = formatManager.createReaderFor(File(start.filename));
if (reader != nullptr)
{
std::unique_ptr<AudioFormatReaderSource> newSource(new AudioFormatReaderSource(reader, true));
transportSource.setSource(newSource.get(), 0, nullptr, reader->sampleRate);
transportSource.setLooping(start.isLooping); // start.isLooping = true
bool testLooping = transportSource.isLooping(); // always false
transportSource.start();
readerSource.reset(newSource.release());
}
}
AudioFormatManager formatManager;
std::unique_ptr<AudioFormatReaderSource> readerSource;
AudioTransportSource transportSource;