Long chinese voice to text with python #2402
Unanswered
alicia2739
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I use whisper to deal long time audio with python, it just return part of the whole audio.
Shorter audio's text is even longer than longer audio's text
Here is my code:
import os
import pandas as pd
import argparse
import whisper
import torch
device = "cuda:0" if torch.cuda.is_available() else "cpu"
print(device)
model = whisper.load_model("base")
获取音频文件夹
def get_voice_folder(source_folder,folder):
folder = os.path.join(source_folder, folder)
voice_folder = os.listdir(folder)
voice_folder = [folder for folder in voice_folder if 'voice' in folder]
voice_folder = voice_folder[0]
voice_folder = os.path.join(folder, voice_folder)
def convert_voice_to_text(source_folder,folder):
voice_folder = get_voice_folder(source_folder,folder)
voice_filenames = os.listdir(voice_folder)
def main():
if name == "main":
main()
Beta Was this translation helpful? Give feedback.
All reactions