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
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")
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.
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
Yes, you can use ExifTool to read metadata in Unity via scripting https://www.sno.phy.queensu.ca/~phil/exiftool/ You can also use Metadata Extractor for C# but that only works for image files: https://github.com/drewnoakes/metadata-extractor-dotnet You can get the metadata out in either strings or json. Now that you mention it, it would be cool to have some "Animation Event" style events that we could just click and add in the Audio Preview inspector.
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.
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!