Merge branch 'master' of bitbucket.org:scorchsoft/text-to-mic-feed

This commit is contained in:
Andrew Ward
2024-05-04 10:17:12 +01:00
2 changed files with 12 additions and 7 deletions

View File

@@ -68,9 +68,14 @@ To get this script working you will need to install the following on the relevan
### Mac ### Mac
* brew install portaudio * brew install portaudio
* pip install python-dotenv * brew install python-tk
* pip install wave * python3 -m venv ~/code/scorchsoft/text-to-mic-feed
* pip install pydub * source ~/code/scorchsoft/text-to-mic-feed/bin/activate
* pip3 install python-dotenv
* pip3 install pyaudio
* pip3 install openai
* pip3 install wave
* pip3 install pydub
# Making an installer # Making an installer

View File

@@ -261,14 +261,14 @@ https://www.scorchsoft.com/blog/text-to-mic-for-meetings/
app_support_path.mkdir(parents=True, exist_ok=True) # Ensure directory exists app_support_path.mkdir(parents=True, exist_ok=True) # Ensure directory exists
return app_support_path return app_support_path
def save_api_key_mac(api_key): def save_api_key_mac(self, api_key):
env_path = get_app_support_path() / '.env' env_path = self.get_app_support_path_mac() / '.env'
with open(env_path, 'w') as f: with open(env_path, 'w') as f:
f.write(f"OPENAI_API_KEY={api_key}\n") f.write(f"OPENAI_API_KEY={api_key}\n")
# Consider manually loading this .env file into your environment as needed # Consider manually loading this .env file into your environment as needed
def load_api_key_mac(): def load_api_key_mac(self):
env_path = get_app_support_path() / '.env' env_path = self.get_app_support_path_mac() / '.env'
if env_path.exists(): if env_path.exists():
with open(env_path, 'r') as f: with open(env_path, 'r') as f:
for line in f: for line in f: