|
|
from server import gt |
|
|
import librosa |
|
|
ref_audio, _ = librosa.load('/home/salman/salman/minomni_sn21/omega-v2v/miner_models/MiniCPM-o/assets/input_examples/assistant_female_voice.wav', sr=16000, mono=True) |
|
|
|
|
|
text = gt(ref_audio, 16_000) |
|
|
print(text) |
|
|
|
|
|
|
|
|
import os |
|
|
def transcribe_directory(): |
|
|
for root, dirs, files in os.walk('/home/salman/salman/minomni_sn21/omega-v2v/miner_models/recordings'): |
|
|
for file in files: |
|
|
if file.endswith('.wav'): |
|
|
print(f"Processing file: {file}") |
|
|
file_path = os.path.join(root, file) |
|
|
audio, sr = librosa.load(file_path, sr=16000, mono=True) |
|
|
transcription = gt(audio, sr) |
|
|
print(f"Transcription for {file_path}: {transcription}") |
|
|
with open(file_path.replace('.wav', '.txt'), 'w') as f: |
|
|
f.write(transcription) |
|
|
|
|
|
|
|
|
transcribe_directory() |