Thanks for your replies.
I’ve been exploring some of the solutions presented in your previous reply, specifically using “FilePlayer” instead of “AudioPlayer”, and have been trying to figure out the ins and outs of connecting that up with my current code, but have so far had unrelated errors, so no idea yet if the files have all loaded.
As far as these questions go:
-
I haven’t tried changing the load order, but just commenting out the first file loaded to see if there’s a problem with the path, file name, or file type specifically. I can take out any one and the other three will load fine. Do you think the order could matter?
-
They are all mp3s that I exported from Adobe Media Encoder with the same settings. I think that all but one of them started as mp3s. Surprisingly the one that started out as a wav file seems smaller than the others. The largest one is about 96kb. They are short sound clips (less than 6 seconds long).
I created a version that uses AudioSampler and all the files will load, but I think that I am getting multiple triggers because of the way the player was set up to respond to key press and release events. The sound has a weird reverby thing going on which I’m assuming has to do with the number of times the file is quickly triggered before I can let up my finger in even a short press. Ultimately, I wanted to be able to have the sound trigger for as long as the button is pressed. I thought the looping would help make the audio files smaller, but apparently not small enough. I haven’t had a chance to wrap my head around achieving this with the AudioSampler yet.
I built this originally on a Windows PC desktop, and it didn’t have any problems. I was hoping to use the Pi so that I could use the GPIO pins and also not need a dedicated PC for what I thought would be a simple soundboard application.
Thanks for any more suggestions you might have. I’ll let you know if I get any results with the FilePlayer route.