Search Unity

Question Automate markers on timeline withe .cue file

Discussion in 'Timeline' started by phdmaxh, Mar 1, 2023.

  1. phdmaxh

    phdmaxh

    Joined:
    Jan 7, 2021
    Posts:
    2
    Hi,
    To make my cut-scenes more efficient and to optimize my workflow, I merge my entire dialogue into one long mp3 file. After that, I create a cue file (some sort of "chapter" divider) with all timestamps regarding which character is talking.

    I’d like to create a script that adds up each marker on the timeline automatically by taking the information from the timestamp/ character from the cue file:

    Code (TXT):
    1.    
    2. Scnene #3 dialogue
    3.     FILE "Dialogue-3" MP3
    4.  
    5.       TRACK 01 AUDIO
    6.            TITLE "01-Character01.mp3"
    7.             INDEX 00:00:00
    8.  
    9.       TRACK 02 AUDIO
    10.             TITLE "02-Character02.mp3"
    11.             INDEX 00:02:30
    12.  
    13.       TRACK 03 AUDIO
    14.             TITLE "03-Character01.mp3"
    15.             INDEX 00:04:05
    16.  
    17.       TRACK 04 AUDIO
    18.             TITLE "04-Character03.mp3"
    19.             INDEX 00:09:06
    20.  
    21.       TRACK 05 AUDIO
    22.             TITLE "05-Character01.mp3"
    23.             INDEX 00:12:52

    Thanks!
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Sounds cool! But I was not sure what the question was...? Are you trying to add markers? Create audio tracks automatically? Create a new custom track type? And what were you after for help?

    In case of interest, I have been using Unity for animation. I have been trying to automate it from a single screenplay script. I automatically create tracks from parsing the screenplay text using a simple markdown-ish like syntax. https://github.com/alankent/OrdinaryCartoonMaker
     
  3. phdmaxh

    phdmaxh

    Joined:
    Jan 7, 2021
    Posts:
    2
    Thank you for your response! Indeed, it wasn't really clear. A picture is worth a thousand words :)
    As you can see from my image, I want to automatically place the cursors on the timeline based on my text file. In addition, curers are also assigned to the correct character.

    upload_2023-3-1_20-49-40.png
    Many thanks!
     
  4. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    My approach for something similar (that project I shared) was to create a window with a multi-line text input field and a button. Clicking the button would parse the string in the field (which I copy and paste from a Google doc) and find the relevant tracks etc (e.g. look at the animation track bindings to work out which character a track is bound to).

    But I am currently thinking about a slightly different approach using a custom track for lipsync control per character and an audio track with a clip per piece of dialog. I plan to create separate clips per piece of dialog instead of one long clip like you have (you can specify the start and end offset for a clip out of the longer audio file). That will let me adjust timing easier by sliding the audio clips for each line of dialog around. The lipsync instructions I will then line up with the audio clips. But still thinking it through.