Crystal-Design commited on
Commit
7e0bf65
1 Parent(s): fe244fb

Create pythen.py

Browse files
Files changed (1) hide show
  1. .vscode/pythen.py +12 -0
.vscode/pythen.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import openai
2
+
3
+ # Set your OpenAI API key
4
+ openai.api_key = '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'
5
+
6
+ # Use raw string to avoid issues with backslashes
7
+ audio_file = open(r"C:/Users/maximilian.aichner/Desktop/Podcast_Alexander_Nitz.mp3", "rb")
8
+
9
+ # Transcribe the audio file
10
+ transcription = openai.Audio.transcribe("whisper-1", audio_file)
11
+
12
+ print(transcription['text'])