yum-slop/TaSTT
Free self-hosted STT for VRChat.
git clone https://git.yummers.dev/yum-slop/TaSTT
f6b93a2
v1.0.0-beta00
1// Shared configuration schema with types and defaults 2const CONFIG_SCHEMA = { 3// String fields 4compute_type : { type : 'select' , default : 'float16' } , 5language : { type : 'select' , default : 'english' } , 6model : { type : 'select' , default : 'turbo' } , 7microphone : { type : 'number' , default : 0 } , 8user_prompt : { type : 'text' , default : 'Use proper punctuation and grammar. Prefer spelled out numbers like one, eleven, twenty, etc. Mm.' } , 9keybind : { type : 'text' , default : 'ctrl+alt+x' } , 10button_hand : { type : 'select' , default : 'right' } , 11button_type : { type : 'select' , default : 'b' } , 12 13// Number fields 14gpu_idx : { type : 'number' , default : 0 } , 15max_speech_duration_s : { type : 'number' , default : 10 } , 16min_speech_duration_ms : { type : 'number' , default : 250 } , 17min_silence_duration_ms : { type : 'number' , default : 100 } , 18reset_after_silence_s : { type : 'number' , default : 15 } , 19transcription_loop_delay_ms : { type : 'number' , default : 100 } , 20block_width : { type : 'number' , default : 2 } , 21num_blocks : { type : 'number' , default : 40 } , 22rows : { type : 'number' , default : 10 } , 23cols : { type : 'number' , default : 24 } , 24beam_size : { type : 'number' , default : 5 } , 25best_of : { type : 'number' , default : 5 } , 26volume : { type : 'number' , default : 30 } , 27 28// Boolean fields (stored as 1/0) 29enable_debug_mode : { type : 'boolean' , default : 0 } , 30enable_previews : { type : 'boolean' , default : 1 } , 31save_audio : { type : 'boolean' , default : 0 } , 32enable_segment_logging : { type : 'boolean' , default : 0 } , 33use_cpu : { type : 'boolean' , default : 0 } , 34enable_lowercase_filter : { type : 'boolean' , default : 0 } , 35enable_uppercase_filter : { type : 'boolean' , default : 0 } , 36enable_profanity_filter : { type : 'boolean' , default : 0 } , 37remove_trailing_period : { type : 'boolean' , default : 0 } , 38reset_on_toggle : { type : 'boolean' , default : 0 } , 39use_builtin : { type : 'boolean' , default : 1 } 40} ; 41 42// Helper to extract just the default values 43function getDefaultConfig () { 44const defaults = {} ; 45for ( const [ key , schema ] of Object . entries ( CONFIG_SCHEMA )) { 46defaults [ key ] = schema . default ; 47} 48return defaults ; 49} 50 51// Export for both CommonJS (main process) and ES modules (renderer) 52if ( typeof module !== 'undefined' && module . exports ) { 53module . exports = { CONFIG_SCHEMA , getDefaultConfig } ; 54} else { 55window . CONFIG_SCHEMA = CONFIG_SCHEMA ; 56window . getDefaultConfig = getDefaultConfig ; 57}