Fit number of plays into given time frame?

Hi, I’m attempting to put together an app for language practice, and part of it will include simply listening to words/phrases, sort of like audio flash cards. So I have numerous words that each belong to a category (greetings, travel, dining, etc.). I want to allow the user to select any number of categories they’d like to practice, as well as a length of time they want to practice for.

So what I’m trying to figure out is how, in the selected time frame, to play a roughly even number of random (shuffled) sounds from each of the selected categories (playlists?), sequentially. So essentially a timeline of playlists that will stretch the number of plays in each playlist to match the given practice time.

So my thought is to have looping shuffled playlists on a timeline and control each playlist’s play count based on # of selected categories & total play time. I figure I need to make the playlists extra long to avoid any cut offs if the playhead reaches the end of playlist before reaching the list’s play count, and destination markers at the start of each playlist. But then my issue is, is there a way to trigger jumping to the next destination marker based on the play count of a playlist completing? Maybe there’s a better way to set this up? Any advice would be appreciated :pray:

I neglected to also mention that I wanted to allow the user to toggle on/off some soft background music during the practice session, obviously also matching the selected play time, but perhaps that makes the multi’s on a timeline approach less viable since the playhead needs to jump around?

It is possible to achieve the behavior you describe in FMOD Studio, by using a combination of timeline logic and automation - but it would be a needlessly complex task compared to tracking the times and play counts required in your game’s code.

Accordingly, we recommend creating an event that contains a multi instrument whose loop mode is enabled and whose playlist contains a programmer instrument (to play a word) and a silence instrument (to give the end user time to think of the word’s meaning or repeat it to themselves). Then, write code that builds up a playlist of words from your audio tables based on your end user’s category selection, and each time the programmer instrument generates a callback, randomly select one of the words from the playlist to play.

1 Like

This doesn’t complicate the situation at all, as the FMOD engine can play multiple events at the same time. Put the music in a different event, and it will have its own timeline, separate from that in your word-playing event.

Fair enough, I thought maybe it’d be less complicated to only be worrying about categories rather than organizing events for each individual word, but this is also my first time using fmod, so I’m still unsure of all the features and best practices… Thanks for your reply!