Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine Music/Sound event into single Audio event #2488

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

salianifo
Copy link
Contributor

Only test on backup timelines, not backwards compatible!

Closes: #2082
Closes: #1306

This PR combines the Music and Sound events into a new Audio event. It will automatically read the old sound/music event formats and convert them into the new audio event format.

Features

  • Named audio channels
    • Channel names do not need to already exist, they are created dynamically
    • Channel names may contain a-z A-Z 0-9 _ -, but they may not be only -
    • Default settings for fade, volume, audio bus, and loop can be configured for named channels in the Audio section of the Dialogic Settings page, or updated/added by clicking the favorite icon next to the channel name in the event itself
    • Selecting/typing a channel name with default settings will override the current settings when the channel dropdown loses focus
    • Playing audio on a channel that is already playing audio will cross-fade from the previous audio to the new audio
  • One-Shot SFX channel
    • This channel is used for short sounds that don't need to be tracked
    • Can play as many audio files as needed simultaneously
  • Sync with channel
    • Allows you to start an audio file at the same position as the currently playing audio on a different channel
    • Can be used for layered audio tracks
    • Cannot be used with WAV files imported using Ima-ADPCM compression due to a Godot bug
  • Looping implemented for WAV files

Text Format

# Plays "file_path" on channel_name with settings in shortcodes,
# defaults for anything not in shortcodes
audio channel_name "file_path" [shortcodes]

# Plays "file_path" as a One-Shot SFX with the default settings
audio "file_path"

# Stops audio playing on channel_name
audio channel_name -

# Stops all One-Shot SFX
audio -

Missing Features

  • Syntax highlighting for the text timeline editor
  • Code completion for the text timeline editor

Additional Changes Made

  • Dynamic options field now has a new ANY_VALID_STRING mode that accepts a validation_func in the extra_info paramter of the event editor build functions
    • Expected return for the validation function is a Dictionary with valid_text and error_tooltip as keys, which are both optional if the text is already valid
    • If valid_text exists in the return from the validation_func, the current_value will be updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve sound event to allow for long sounds Proposal: Unify Sound and Music event
1 participant