Skip to content

Commit

Permalink
change debug default
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Loftus committed Feb 15, 2024
1 parent 72c254e commit 9cd6a80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
30 changes: 1 addition & 29 deletions core/additional_voices/additional-voices.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,7 @@
@mod.action_class
class Actions:

def openai_tts(text: str):
"""text to speech with openai"""
url = "https://api.openai.com/v1/audio/speech"
try:
TOKEN = os.environ["OPENAI_API_KEY"]
except:
actions.user.tts("GPT Failure: No API Key")
return

headers = {
"Authorization": f"Bearer {TOKEN}",
"Content-Type": "application/json",
}

data = {
"model": "tts-1",
"input": text,
"voice": "alloy",
}

response = requests.post(url, headers=headers, data=json.dumps(data))

if response.status_code == 200:
date = time.strftime("%Y-%m-%d-%H-%M-%S")
with open(f"openai-speech-{date}.mp3", "wb") as f:
f.write(response.content)
print("Speech successfully saved to openai-speech.mp3")
else:
print(f"Error: {response.status_code}, {response.text}")



def elevenlabs_tts(text: str):
Expand Down
2 changes: 1 addition & 1 deletion sight-free-settings.talon
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ settings():
user.announce_mode_updates = true

# Display debugging output for NVDA
user.addon_debug = true
user.addon_debug = false

# Every given number of minutes, send a notification, prompting you to rest your eyes
# user.enable_break_timer = true
Expand Down

0 comments on commit 9cd6a80

Please sign in to comment.