Page 1 of 1

Censuring audio swear words with beeps

Posted: Wed Jan 11, 2023 1:12 am
by EntertainmentForge
How would you implement censorship beeps in voice acting using Dialogue System? I am making a game that will have swear words but I'd like to let players turn on censorship if they don't want them.

I am thinking about having two audio clips for each file with a swear word. In that case, how could I choose to play a different clip if my censorship option is enabled?

An even better option would be playing a beep sound over the audio clips exactly at the specified time (during curse word). Is there maybe any feature like that?

Thank you!

Re: Censuring audio swear words with beeps

Posted: Wed Jan 11, 2023 8:22 am
by Tony Li
Hi,

I recommend two separate audio files -- one explicit and one edited to beep out swear words.

It's safer. If you tried the other approach and the timing was off for some reason, it might not correctly beep at the right time.

And it's also easier because you can use the Dialogue System's built-in localization system. Define an additional language named "Explicit" and use it for text and for entrytaglocal in sequences. Example:

(Warning -- explicit language below)
  • Dialogue Text: "This s**t is dope as f**k!"
  • Explicit: "This shit is dope as fuck!"
  • Sequence: AudioWait(entrytaglocal)
This assumes that you've defined a custom Localization field in your dialogue entry template named "Explicit" and that you've named your audio clips something like "Player_7_42" and "Player_7_42_Explicit". (See Entrytags)

To play explicit text and audio, change the language to "Explicit": DialogueManager.SetLanguage("Explicit").

Re: Censuring audio swear words with beeps

Posted: Thu Jan 12, 2023 12:59 am
by EntertainmentForge
I was also thinking about using it as another language. But won't I have to have every audio file twice in that case? Since it will load only files that have "Explicit". Is there a way to only load "Explicit" if there is "Explicit" version? And if not to load normal audio file?

To clarify. If line is just Player_7_42, play that. But if it also has Player_7_42_Explicit, then load that line (if censorship is turned on)

Re: Censuring audio swear words with beeps

Posted: Thu Jan 12, 2023 8:48 am
by Tony Li
That's a good point. You could duplicate SequencerCommandAudioWait.cs (e.g., as something like SequencerCommandPlayVoice.cs) and customize it to look for the "_Explicit" version of the specified file if the language is set to Explicit. If it doesn't find it, or if the language isn't set to Explicit, play the regular file.