-
Notifications
You must be signed in to change notification settings - Fork 3
CharacterDatabase
The character database is a class that can load and convert from CSV and JSON files for how to store a list of character objects. It can also save the character database to a CSV or JSON file. The character database can be used to get a character by name, ref_id, or base_id. It can also be used to compare two character databases and return the differences between them. The character database can also be used to get a list of available voice models and voice folders and is used during startup to figure out which voices aren't accounted for by any of the TTSes.
-
__init__(self, config, synthesizer, conversation_manager, character_database_path, db_type='json'): Initializes the character database with the given configuration, synthesizer, conversation manager, character database path, and database type. -
loaded(self): Returns whether the character database has been loaded. -
load(self): Loads the character database from the character database path. -
load_characters_json(self, path): Loads the character database from a JSON file. -
load_characters_csv(self, path): Loads the character database from a CSV file. -
format_character(self, character): Formats a character object to have the necessary fields. -
get_unique_ref_index(self, character): Returns the unique reference index for a character. -
characters: Returns the characters in the character database. -
patch_character_info(self, info): Patches information about a character into the character database and saves the changes to the JSON file. -
get_character_by_name(self, name): Gets a character from the character database using the character's name. -
get_character_by_voice_folder(self, voice_folder): Looks through non-generic characters for a character with the given voice folder. -
get_voice_folder_by_voice_model(self, voice_model): Gets the voice folder for a given voice model. -
verify_characters(self): Verifies the characters in the character database. -
get_character(self, character_name, character_ref_id=None, character_base_id=None, character_in_game_race=None, character_in_game_gender=None, character_is_guard=None, character_is_ghost=None, in_game_voice_model=None, location=None): Gets a character from the character database using the character's name, ref_id, or base_id. -
_get_character(self, character_name, character_ref_id=None, character_base_id=None, character_in_game_race=None, character_in_game_gender=None, character_is_guard=None, character_is_ghost=None, in_game_voice_model=None, location=None): Gets a character from the character database using the character's name, ref_id, or base_id. -
has_character(self, character): Checks if a character is in the character database. -
compare(self, db): Compares this character database with another character database and returns the differences. -
save(self, path, type='json'): Saves the character database to a JSON directory or CSV file. -
male_voice_models: Returns a dictionary -
female_voice_models: Returns a dictionary -
all_voice_models: Returns a list of all voice models -
voice_folders: Returns a dictionary of voice models and their corresponding voice folders -
all_voice_folders: Returns a list of all voice folders
__init__(self, config, synthesizer, conversation_manager, character_database_path, db_type='json') Method
Initializes the character database with the given configuration, synthesizer, conversation manager, character database path, and database type.
Returns whether the character database has been loaded.
Loads the character database from the character database path.
Loads the character database from a JSON file.
Loads the character database from a CSV file.
Formats a character object to have the necessary fields.
Returns the unique reference index for a character.
Returns the characters in the character database.
Patches information about a character into the character database and saves the changes to the JSON file.
Gets a character from the character database using the character's name.
Looks through non-generic characters for a character with the given voice folder.
Gets the voice folder for a given voice model.
Verifies the characters in the character database.
get_character(self, character_name, character_ref_id=None, character_base_id=None, character_in_game_race=None, character_in_game_gender=None, character_is_guard=None, character_is_ghost=None, in_game_voice_model=None, location=None) Method
Gets a character from the character database using the character's name, ref_id, base_id, in-game race and gender, whether the character is a guard or ghost, the in-game voice model, and the location.
_get_character(self, character_name, character_ref_id=None, character_base_id=None, character_in_game_race=None, character_in_game_gender=None, character_is_guard=None, character_is_ghost=None, in_game_voice_model=None, location=None) Method
Gets a character from the character database using the character's name, ref_id, base_id, in-game race and gender, whether the character is a guard or ghost, the in-game voice model, and the location.
Checks if a character is in the character database.
Compares this character database with another character database and returns the differences.
Saves the character database to a JSON directory or CSV file.
Returns a dictionary of all male voice models.
Returns a dictionary of all female voice models.
Returns a list of all voice models.
Returns a dictionary of voice models and their corresponding voice folders.
Returns a list of all voice folders.