Search Unity

Audio Audio-Video Markers

Discussion in 'Audio & Video' started by Adrian_pro, Dec 17, 2018.

  1. Adrian_pro

    Adrian_pro

    Joined:
    May 23, 2013
    Posts:
    26
    Hi all,
    It is possible to add some kind of trigger on a sound clip or a video, so at the second 00:35 to get a signal and at the second 00:55 to get another signal ( trigger, text, bool... anything)?
    Any solution that can be used in scripting.

    Thanks in advance!

    Cheers
    Adrian
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,435
    depending which video player you are using, you can access current time or frame from the video,
    so then can call your events from script.. (by having it constantly checking "are we in frame 9000 yet")
     
  3. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Hi Adrian, I did this with Audio files using Metadata. You could write metadata manually and it is complicated but I was able to use Adobe Audition.



    On the left are markers and you can see what time they're set at in the timeline on the right.

    When the audio file is read in Unity, I extract the metadata which includes the marker's times. After that you can check where the playback 'cursor' is at and when the times match, execute your event. I was able to use different types of markers in Audition to trigger different types of events in Unity.

    This way, the audio file or video file would have the event triggers "built in" an nothing else needs to be done except import the file and play it.
     
  4. Adrian_pro

    Adrian_pro

    Joined:
    May 23, 2013
    Posts:
    26
    Can you read metadata in unity using scripting?
    All this metadata will be read as a string?
    Yes is a lot of preparation but is good for an interesting goal, a cool workaround.

    @mgear this is a complicated workaround but it might work also.... maybe we can find a cool solution for Audio and Video to trigger events
     
  5. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Last edited: Dec 17, 2018
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,435
    probably could use Timeline for this also.

    or if some audio editing tool allows scripting,
    it could output those marker positions into separate text file.
     
  7. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    1,089
    Just saw this now (from another thread)...

    Our Koreographer asset does this very thing (for AudioClips). The base edition is sufficient for basic signal/trigger workflows. The Professional Edition provides you with a MIDI Converter (convert MIDI events into events), expanded Payload types, and added integrations with third party audio engines.

    Hope you were able to figure something out!