Unity-Simple-SRT icon indicating copy to clipboard operation
Unity-Simple-SRT copied to clipboard

An array of audioclips?

Open albertobonanni opened this issue 4 years ago • 1 comments
trafficstars

Great, simple script! I am trying to work on it as I need different audio files to play along with different sub texts based on different colliders. Any idea on how to achieve this? After setting the array ([]) at the beginning of the displayer script, I am a little lost.

Thank you in advance for your help!

albertobonanni avatar Jan 21 '21 19:01 albertobonanni

Hey @albertobonanni ! Just my two cents, if you haven't already come up with a solution I would move responsability of coordinating multiple audio files and their subtitles to someone else besides the displayer script, let's call it an AudioCoordinator, have it be responsible for:

  • telling your AudioSource (or whatever playback method) and ScriptDisplayer the current audio file and matching current subtitle file
  • detecting the end of your audio clip (https://forum.unity.com/threads/detecting-end-of-audio-clip.60897/) and moving onto the next audio clip and subtitle file

yoiang avatar Apr 03 '21 04:04 yoiang