forked from woofmeow/straywild
feat: add selectable animalese voice sets
This commit is contained in:
parent
364e7dc282
commit
ce733818e2
247 changed files with 2675 additions and 302 deletions
|
|
@ -2,9 +2,27 @@ class_name AnimaleseVoiceProfiles
|
|||
extends RefCounted
|
||||
|
||||
const DEFAULT_ID: String = "natural"
|
||||
const DEFAULT_SAMPLE_SET_ID: String = "kat"
|
||||
const DEFAULT_SPEED_ID: String = "normal"
|
||||
const DEFAULT_CALL_ID: String = "meow"
|
||||
const CALL_AUDIO_DIRECTORY: String = "res://sound/dialogue/calls"
|
||||
const SAMPLE_SET_OPTIONS: Array[Dictionary] = [
|
||||
{
|
||||
"id": "kat",
|
||||
"label": "kat",
|
||||
"directory": "res://sound/dialogue/animalese/alphanumeric",
|
||||
},
|
||||
{
|
||||
"id": "robot",
|
||||
"label": "robot",
|
||||
"directory": "res://sound/dialogue/animalese/robot",
|
||||
},
|
||||
{
|
||||
"id": "kim",
|
||||
"label": "kim",
|
||||
"directory": "res://sound/dialogue/animalese/kim",
|
||||
},
|
||||
]
|
||||
const OPTIONS: Array[Dictionary] = [
|
||||
{"id": "tiny", "label": "tiny", "pitch": 1.24},
|
||||
{"id": "bright", "label": "bright", "pitch": 1.10},
|
||||
|
|
@ -12,6 +30,31 @@ const OPTIONS: Array[Dictionary] = [
|
|||
{"id": "mellow", "label": "mellow", "pitch": 0.89},
|
||||
{"id": "deep", "label": "deep", "pitch": 0.77},
|
||||
]
|
||||
|
||||
|
||||
static func is_valid_sample_set(sample_set_id: String) -> bool:
|
||||
for option: Dictionary in SAMPLE_SET_OPTIONS:
|
||||
if str(option.get("id", "")) == sample_set_id:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
static func sanitized_sample_set_id(sample_set_id: String) -> String:
|
||||
return (
|
||||
sample_set_id
|
||||
if is_valid_sample_set(sample_set_id)
|
||||
else DEFAULT_SAMPLE_SET_ID
|
||||
)
|
||||
|
||||
|
||||
static func sample_directory_for(sample_set_id: String) -> String:
|
||||
var resolved_id := sanitized_sample_set_id(sample_set_id)
|
||||
for option: Dictionary in SAMPLE_SET_OPTIONS:
|
||||
if str(option.get("id", "")) == resolved_id:
|
||||
return str(option.get("directory", ""))
|
||||
return ""
|
||||
|
||||
|
||||
const SPEED_OPTIONS: Array[Dictionary] = [
|
||||
{"id": "slow", "label": "slow", "characters_per_second": 20.0},
|
||||
{"id": "relaxed", "label": "relaxed", "characters_per_second": 24.0},
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ const HeldItemAttachmentScene = preload(
|
|||
"res://player/held_item_attachment.tscn"
|
||||
)
|
||||
const SprintDustTrailType = preload("res://player/sprint_dust_trail.gd")
|
||||
const VoiceProfilesType = preload(
|
||||
"res://player/animalese_voice_profiles.gd"
|
||||
)
|
||||
|
||||
signal retract_visual_finished
|
||||
|
||||
|
|
@ -124,7 +127,8 @@ const CONTROLLER_ZOOM_TRIGGER_AXIS: JoyAxis = JOY_AXIS_TRIGGER_LEFT
|
|||
var appearance_snapshot: Dictionary = (
|
||||
CharacterCustomizationCatalog.default_snapshot()
|
||||
)
|
||||
var animalese_voice_id: String = "natural"
|
||||
var animalese_voice_id: String = VoiceProfilesType.DEFAULT_ID
|
||||
var animalese_sample_set_id: String = VoiceProfilesType.DEFAULT_SAMPLE_SET_ID
|
||||
var active_bait_id: StringName = StringName()
|
||||
var active_lure_id: StringName = StringName()
|
||||
signal active_bait_changed(item_id: StringName)
|
||||
|
|
@ -282,12 +286,22 @@ func _apply_presented_appearance() -> void:
|
|||
|
||||
|
||||
func apply_animalese_voice_id(voice_id: String) -> void:
|
||||
animalese_voice_id = voice_id
|
||||
animalese_voice_id = VoiceProfilesType.sanitized_id(voice_id)
|
||||
|
||||
|
||||
func get_animalese_voice_id() -> String:
|
||||
return animalese_voice_id
|
||||
|
||||
|
||||
func apply_animalese_sample_set_id(sample_set_id: String) -> void:
|
||||
animalese_sample_set_id = VoiceProfilesType.sanitized_sample_set_id(
|
||||
sample_set_id
|
||||
)
|
||||
|
||||
|
||||
func get_animalese_sample_set_id() -> String:
|
||||
return animalese_sample_set_id
|
||||
|
||||
class ShowcaseCameraSnapshot:
|
||||
extends RefCounted
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue