Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何使用FunASR的Emotion2Vec+ Large模型转录音频 , you can see the code that works but transcribes audio in text i want it in srt #648

Open
abhijeet12s opened this issue Dec 1, 2024 · 1 comment

Comments

@abhijeet12s
Copy link

abhijeet12s commented Dec 1, 2024

如何使用FunASR的Emotion2Vec+ Large模型转录音频

Screenshot 2024-12-01 111017

操作系统

  • Windows

code that works :
image
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

Initialize the ASR pipeline

asr_pipeline = pipeline(
task=Tasks.auto_speech_recognition,
model='iic/emotion2vec_plus_large'
)

Path to your audio file

audio_file = r"C:\Users\abhij\Downloads\3mau (enhanced).wav"

Transcribe the audio

result = asr_pipeline(audio_file)

Print the transcription result

print("Transcription:", result['text'])

Optional: Save to file

with open("transcription.txt", "w", encoding="utf-8") as f:
f.write(result['text'])

@abhijeet12s abhijeet12s changed the title 如何使用FunASR的Emotion2Vec+ Large模型转录音频 如何使用FunASR的Emotion2Vec+ Large模型转录音频 , you can see the code that works but transcribes audio in text i want it in srt Dec 1, 2024
@jianchang512
Copy link
Owner

测试过么,能输出带时间戳信息么

print("Transcription:", result['text'])

贴下图看看输出什么

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants