How would one go about creating a 'beat box' style sound engine, where a series of sounds can be queued up ahead of time and during playback. These sounds need to play back without any gaps or hiccups though.
I've looked into OpenAL and have attempted to use the alSourceQueueBuffers() to create a source with a series of pre-buffered clips, but did not achieve what I was looking for.
I load my audio files with AudioFileOpenURL, and then load it into a char array with AudioFileReadBytes, creating a buffer with alGenBuffers and then buffering with alBufferData.
I then create a source with alGenSources, and hold onto a reference to that source. I then call alSourceQueueBuffers(sourceId, 1, &bufferId) a handful of times where bufferId is a parameter passed into my 'queueClip' method and references a handful of different clips.
After doing this, and calling alSourcePlay I hear what appears to be two of my clips playing, back-to-back ... but then nothing (I loaded it up with 3 audio files, and randomly adding them to the source with alSourceQueueBuffers a couple of times).
I also need to know the best way to update my source, to add new sounds to it and remove already played sounds from it to clean up memory, etc.