Skip to content

Commit

Permalink
#Update - Add form to configure dual voices (incomplete_)
Browse files Browse the repository at this point in the history
  • Loading branch information
SanHacks committed Nov 8, 2023
1 parent bdbdaa4 commit f77069b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
Binary file modified DB/settings.db
Binary file not shown.
4 changes: 2 additions & 2 deletions Variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ package main
// I REPEAT, DO NOT LEAK YOUR KEYS.
// NOW REPEAT WITH ME, "I WILL NOT LEAK MY TOKENS"!
const (
openKeys = "OPENAI"
speechKeys = "AZURE"
openKeys = "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"
speechKeys = "69fffe07f90a4505a58dc14425dff6a8"
)
20 changes: 20 additions & 0 deletions aigenUi/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ func ChangeSetting(soundIsOn int) {
}
}

func ChangeVoice(provider string) {
db, err := sql.Open("sqlite3", SettingsDB)
if err != nil {
log.Printf("Error opening database: %v", err)
}
defer func(db *sql.DB) {
err := db.Close()
if err != nil {
log.Println(err)
}

}(db)

// Insert the keylogger into the database
_, err = db.Exec("INSERT INTO settings (speech_provider) VALUES (?)", provider)
if err != nil {
log.Printf("Error inserting into database: %v", err)
}
}

func SoundIsOffON(soundIsOff int) {
db, err := sql.Open("sqlite3", SettingsDB)
if err != nil {
Expand Down
13 changes: 13 additions & 0 deletions aigenUi/uiSettingsTab.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ func AudioSettingsTab() *container.TabItem {
return audioSettingsTab
}

func DualVoiceSettings() *container.TabItem {
DualVoice := container.NewTabItem("Dual Speech Settings",
widget.NewSelect([]string{"AzureSpeech", "OpenAI"}, func(value string) {
log.Println("Select set to", value)
//UpdateSpeechProvider(value)
}))
return DualVoice
}

func UpdateSpeechProvider(value string) {
ChangeVoice(value)
}

func AudioSettings(soundIsOn int) {
ChangeSetting(soundIsOn)
}
Expand Down
1 change: 1 addition & 0 deletions dbChef.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func createSettingsDatabase() error {
platform TEXT DEFAULT NULL,
audioOnly INTEGER DEFAULT 1,
theme TEXT DEFAULT 'auto',
voice TEXT DEFAULT 'AZURESPEECH',
language TEXT DEFAULT NULL,
createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
accessToken TEXT DEFAULT NULL,
Expand Down
3 changes: 2 additions & 1 deletion mainApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ func mainApp(mapungubwe fyne.App) (*container.AppTabs, *container.Split) {
chatMediaTab := aigenUi.UserMedia()
//developerMode := aigenUi.Developer()
audioSettingsTab := aigenUi.AudioSettingsTab()
DualVoiceSettings := aigenUi.DualVoiceSettings()
//Create the tabs container and add the tabs to it
tabs := container.NewAppTabs(aiGen, //financeTab,
extendAI, chatMediaTab, settingsTab, audioSettingsTab)
extendAI, chatMediaTab, settingsTab, audioSettingsTab, DualVoiceSettings)

inputBoxContainer := SignInHandler(chat, tabs, aiGen)

Expand Down

0 comments on commit f77069b

Please sign in to comment.