Typewriter sound effects

  • #1, by shiritoruThursday, 15. May, 15:52 11 hours ago
    Hello again!

    So, I set up the typewritter effect for the speach, and really want to add sounds to it.
    (just a subtle soft beeping, nothing extreme)

    The only hint I was able to find is that:

    - Events for text transitions, TextTransitionSkipped, TextTransitionIndex. Example for playing a sound for the type writer effect (only sent from the fade effect):
    function engineEvent(type, data)
      if type == "TextTransitionIndex" then
        AudioBusses["Random"]:start()
      end
    end
    registerEventHandler("engineEvent", "engineEvent")
     But honestly, as any other information is missing and I still have no acess to Visionaire's Wiki, I have no idea how to use it properly.

    I'd be grateful if someone could help me with that.

    Newbie

    23 Posts


  • #2, by shiritoruThursday, 15. May, 16:10 10 hours ago
    So, after a bit of investigation I made it work. Kinda.

    First: created a random audio container and attached a sound to it.
    Second: created a code part

    Issues I can't solve for now:

    How to attach different sounds to different characters?
    How to make sound to stop when skipping text transition (clicking to make text to stop "typewriting" and displaying fully)

    I'd be grateful to any help. 

    Newbie

    23 Posts

  • #3, by SimonSThursday, 15. May, 16:50 10 hours ago
    1) You need the text owner from the text start.
    2) You need to call :stop() on TextTransitionSkipped

    e.g.:

    local busToPlay = AudioBusses["Random"]
    function txtStart(text)
     if text.Owner == Characters["Name"] then
       busToPlay = AudioBusses["Random"]
     end
     if text.Owner == Characters["Name2"] then
       busToPlay = AudioBusses["Random2"]
     end
    end
    registerEventHandler("textStarted","txtStart")
    function engineEvent(type, data)
      if type == "TextTransitionIndex" then
        busToPlay:start()
      end
      if type == "TextTransitionSkipped" then
        busToPlay:start()
      end
    end
    registerEventHandler("engineEvent", "engineEvent")

    Thread Captain

    1604 Posts

  • #4, by shiritoruThursday, 15. May, 17:01 9 hours ago
    1) You need the text owner from the text start.
    2) You need to call :stop() on TextTransitionSkipped

    e.g.:

    local busToPlay = AudioBusses["Random"]
    function txtStart(text)
     if text.Owner == Characters["Name"] then
       busToPlay = AudioBusses["Random"]
     end
     if text.Owner == Characters["Name2"] then
       busToPlay = AudioBusses["Random2"]
     end
    end
    registerEventHandler("textStarted","txtStart")
    function engineEvent(type, data)
      if type == "TextTransitionIndex" then
        busToPlay:start()
      end
      if type == "TextTransitionSkipped" then
        busToPlay:start()
      end
    end
    registerEventHandler("engineEvent", "engineEvent")

    First part is working perfectly, thank you so much!

    The stopping part is not 
    if type == "TextTransitionSkipped" then
        busToPlay:start()
    Should it be 

     busToPlay:stop()
    here?

    (Doesn't work either)

    Newbie

    23 Posts

Write post