diff --git a/src/blackbox_m_test.py b/src/blackbox_m_test.py new file mode 100644 index 0000000..40fcc34 --- /dev/null +++ b/src/blackbox_m_test.py @@ -0,0 +1,57 @@ +# Import necessary libraries +import os +import glob +import sqlite3 +from whisper import Whisper + +# Initialize Whisper model +model = Whisper() + +# Function to transcribe audio file +def transcribe_audio(audio_file): + transcription = model.transcribe(audio_file) + return transcription + +# Function to extract audio from video file +def extract_audio(video_file, output_path): + # Use ffmpeg to extract audio from video + os.system(f'ffmpeg -i {video_file} -vn -ab 256 {output_path}') + +# Function to log file paths and transcriptions +def log_file(file_path, transcription): + # Connect to SQLite database + conn = sqlite3.connect('files.db') + c = conn.cursor() + + # Create table if it doesn't exist + c.execute('''CREATE TABLE IF NOT EXISTS files + (file_path TEXT PRIMARY KEY, transcription TEXT)''') + + # Insert file path and transcription into table + c.execute("INSERT OR REPLACE INTO files (file_path, transcription) VALUES (?,?)", (file_path, transcription)) + + # Commit changes and close connection + conn.commit() + conn.close() + +# Get list of video and audio files in directories +video_files = [] +audio_files = [] +for dirpath, dirnames, filenames in os.walk('C:\\Users\\lundg\\Videos'): + for filename in filenames: + if filename.endswith('.mp4') or filename.endswith('.avi') or filename.endswith('.mkv'): + video_files.append(os.path.join(dirpath, filename)) + elif filename.endswith('.mp3') or filename.endswith('.wav'): + audio_files.append(os.path.join(dirpath, filename)) + +# Extract audio from video files and transcribe +for video_file in video_files: + audio_path = os.path.join(os.path.dirname(video_file), 'audio_' + os.path.basename(video_file)) + extract_audio(video_file, audio_path) + transcription = transcribe_audio(audio_path) + log_file(video_file, transcription) + +# Transcribe existing audio files +for audio_file in audio_files: + transcription = transcribe_audio(audio_file) + log_file(audio_file, transcription) \ No newline at end of file diff --git a/src/claude_eval.py b/src/claude_eval.py new file mode 100644 index 0000000..2d14456 --- /dev/null +++ b/src/claude_eval.py @@ -0,0 +1,30 @@ + +#declare each video path to track down captures +#specific folders to monitor: +# C:\Users\lundg\Videos\Captures +# "C:\Users\lundg\Videos\Clip Champ" +# "C:\Users\lundg\Videos\Call of Duty Modern Warfare 3 (2023)" +# "C:\Users\lundg\Videos\Desktop" +# "C:\Users\lundg\Videos\SteelSeries Moments" +# "C:\Users\lundg\Videos\Captures" +# "C:\Users\lundg\Videos\Fortnite" +# "C:\Users\lundg\Videos\RealVNC" + +#essentially any picture of video under C://Users//lundg//Videoo + +# pictures, audio files and video files(and paths) need to be logged for of all files(videos and pictures in this directories) and store them in a list +#each file that is tracked with an object should also be logged in a db? + + +#figure out how to separate audio from video files via an api or cli + +#example extract audio from video.mp4 and save it as audio.mp3 + + + + + +#user can select a audio file and transcribe it with whisper + +#figure out how to design a gui in vscode that can front end this +# \ No newline at end of file diff --git a/src/copilot.py b/src/copilot.py new file mode 100644 index 0000000..2d14456 --- /dev/null +++ b/src/copilot.py @@ -0,0 +1,30 @@ + +#declare each video path to track down captures +#specific folders to monitor: +# C:\Users\lundg\Videos\Captures +# "C:\Users\lundg\Videos\Clip Champ" +# "C:\Users\lundg\Videos\Call of Duty Modern Warfare 3 (2023)" +# "C:\Users\lundg\Videos\Desktop" +# "C:\Users\lundg\Videos\SteelSeries Moments" +# "C:\Users\lundg\Videos\Captures" +# "C:\Users\lundg\Videos\Fortnite" +# "C:\Users\lundg\Videos\RealVNC" + +#essentially any picture of video under C://Users//lundg//Videoo + +# pictures, audio files and video files(and paths) need to be logged for of all files(videos and pictures in this directories) and store them in a list +#each file that is tracked with an object should also be logged in a db? + + +#figure out how to separate audio from video files via an api or cli + +#example extract audio from video.mp4 and save it as audio.mp3 + + + + + +#user can select a audio file and transcribe it with whisper + +#figure out how to design a gui in vscode that can front end this +# \ No newline at end of file diff --git a/src/greg.py b/src/greg.py new file mode 100644 index 0000000..a3d5149 --- /dev/null +++ b/src/greg.py @@ -0,0 +1,31 @@ +# fsaf + +#declare each video path to track down captures +#specific folders to monitor: +# C:\Users\lundg\Videos\Captures +# "C:\Users\lundg\Videos\Clip Champ" +# "C:\Users\lundg\Videos\Call of Duty Modern Warfare 3 (2023)" +# "C:\Users\lundg\Videos\Desktop" +# "C:\Users\lundg\Videos\SteelSeries Moments" +# "C:\Users\lundg\Videos\Captures" +# "C:\Users\lundg\Videos\Fortnite" +# "C:\Users\lundg\Videos\RealVNC" + +#essentially any picture of video under C://Users//lundg//Videoo + +# pictures, audio files and video files(and paths) need to be logged for of all files(videos and pictures in this directories) and store them in a list +#each file that is tracked with an object should also be logged in a db? + + +#figure out how to separate audio from video files via an api or cli + +#example extract audio from video.mp4 and save it as audio.mp3 + + + + + +#user can select a audio file and transcribe it with whisper + +#figure out how to design a gui in vscode that can front end this +# \ No newline at end of file diff --git a/tests/test_audio.py b/tests/test_audio.py index dfd78bc..420b8a2 100644 --- a/tests/test_audio.py +++ b/tests/test_audio.py @@ -17,3 +17,5 @@ def test_audio(): assert np.allclose(mel_from_audio, mel_from_file) assert mel_from_audio.max() - mel_from_audio.min() <= 2.0 + +