Where Is User Configuration Stored in Voice-Pro? A Complete Guide to config-user.json5

Voice-Pro stores all persistent user settings in app/config-user.json5, a JSON5 file managed by the UserConfig class in src/config.py which handles loading defaults, reading user overrides, and writing changes back to disk.

Voice-Pro, an open-source audio processing application, persists user preferences between sessions using a structured configuration system. Understanding where user configuration is stored in Voice-Pro is essential for troubleshooting, backing up settings, or extending the application. The repository uses a hybrid approach combining default values with user-specific overrides stored in a dedicated JSON5 file.

Configuration File Location and Format

Voice-Pro keeps all customizable settings in a single file within the application directory structure.

The config-user.json5 File Path

The primary storage location is app/config-user.json5 in the repository root. This file uses the JSON5 format, which allows for comments and trailing commas while remaining compatible with standard JSON parsers. When the application starts, it looks for this specific path to load any user-defined overrides to the default settings.

Default vs. User Configuration

If config-user.json5 is missing or corrupted, Voice-Pro falls back to the default_user_config dictionary defined in the source code. This ensures the application always has valid configuration values even on first launch.

How Voice-Pro Loads and Saves Configuration

The configuration management is centralized in a dedicated Python class that abstracts file I/O operations.

The UserConfig Class in src/config.py

According to the Voice-Pro source code, the UserConfig class defined in src/config.py serves as the single interface for all configuration operations. The constructor receives the path to the configuration file and initializes the loading process:


# From src/config.py lines 15-18

def __init__(self, config_path):
    self.config_path = config_path
    self.config = {}
    self.load_user_config()

Reading and Writing Operations

On initialization, load_user_config() attempts to read the JSON5 file. As implemented in lines 92-98, if the file cannot be read, the system uses the defaults instead. When settings change via the set() method, the updated dictionary is immediately written back to app/config-user.json5:


# From src/config.py lines 11-14

def set(self, key, value):
    self.config[key] = value
    self.save_user_config()  # Persists to config-user.json5

The load_user_config() method implements the fallback logic:


# From src/config.py lines 92-98

def load_user_config(self):
    try:
        with open(self.config_path, 'r') as f:
            self.config = json5.load(f)
    except:
        self.config = default_user_config.copy()

Accessing Configuration Data Programmatically

Developers and advanced users can interact with the configuration system directly using the UserConfig API.

The class provides convenient get and set methods that UI widgets use to retrieve initial values and persist changes. Here is how to interact with the configuration storage programmatically:

from src.config import UserConfig
import os

# Resolve the path to the user config (same logic used by the app)

user_config_path = os.path.join(
    os.path.dirname(__file__), "app", "config-user.json5"
)

# Create a UserConfig instance

cfg = UserConfig(user_config_path)

# Retrieve a setting (falls back to default if missing)

asr_engine = cfg.get("asr_engine", "faster-whisper")
print(f"Current ASR engine: {asr_engine}")

# Update a setting – the change is saved immediately to config-user.json5

cfg.set("asr_engine", "whisper")
print("ASR engine updated to 'whisper'")

Summary

  • Voice-Pro stores user configuration in app/config-user.json5 using the JSON5 format.
  • The UserConfig class in src/config.py manages all read/write operations for this file.
  • Configuration follows a fallback pattern: if the user file is missing, default values from default_user_config are used.
  • Changes made via UserConfig.set() are persisted immediately to disk.
  • UI widgets initialize their values using user_config.get(key, default).

Frequently Asked Questions

What file format does Voice-Pro use for configuration?

Voice-Pro uses JSON5 for its user configuration file. This format extends standard JSON by allowing comments, trailing commas, and unquoted keys, making it more human-readable and editable than strict JSON while maintaining machine parseability.

Where is the default configuration defined if I delete config-user.json5?

The default configuration is defined as the default_user_config dictionary within src/config.py. If the app/config-user.json5 file is deleted or cannot be read, the UserConfig class automatically falls back to these hardcoded defaults when load_user_config() is called, as shown in lines 92-98.

Can I manually edit the Voice-Pro configuration file?

Yes, you can manually edit app/config-user.json5 since it uses the JSON5 format. However, ensure the file remains valid JSON5 syntax. The application will read your changes on the next startup via the load_user_config() method in the UserConfig class.

How does Voice-Pro handle corrupted configuration files?

If config-user.json5 is corrupted or unreadable, the UserConfig class catches the exception in load_user_config() and falls back to the default configuration dictionary. This prevents application crashes and ensures Voice-Pro remains functional even with malformed configuration files.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →