How do you make an AuGraph restart a audio file from the start of the file?
-
16-06-2021 - |
Question
I am working with Apple's MixerHost application. It is a great example of how to set up an AuGraph, however the stop button is really a pause button. When you hit play it continues playing the sound files from the last position. I want to have a true stop button that causes the play head to move back to the start. I looked up AuGraph in apple's docs but I do not see anything about starting the song over without having to go through the process if creating a brand new graph, and I would prefer not to have to do this since i have a large loading delay.
Solution
Figured it out. This was my method
for (int audioFile = 0; audioFile < NUM_FILES; ++audioFile) {
soundStructArray[audioFile].sampleNumber = 0;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow