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

声音卡顿 #360

Open
gg22mm opened this issue Jan 18, 2025 · 2 comments
Open

声音卡顿 #360

gg22mm opened this issue Jan 18, 2025 · 2 comments

Comments

@gg22mm
Copy link

gg22mm commented Jan 18, 2025

长文字如下:
9月17日凌晨,刚刚在全国田径锦标赛夺冠的吴艳妮在社交平台发文,为自己第一次实现年度大满贯而感到自豪,同时祝大家中秋节快乐

测试的时候一卡一卡的,应该是声音分割的时候再播放就卡顿:

1.18.mp4
# 跟我下面这个例子做的测试效果很像
from pydub import AudioSegment
from pydub.playback import play

# 加载音频文件
audio = AudioSegment.from_file("yongen_diy.wav")

frame_rate = audio.frame_rate  
frame_size=frame_rate//25 

# 分割音频为帧
for i in range(0, len(audio), frame_size):
    frame = audio[i:i + frame_size]   
    if len(frame) == frame_size:
    	print('--------------3-----',frame)
    	play(frame)# 播放音频片段
@lipku
Copy link
Owner

lipku commented Jan 18, 2025

你看看fps是多少,到25就不会卡顿

@gg22mm
Copy link
Author

gg22mm commented Jan 19, 2025

你看看fps是多少,到25就不会卡顿

我用的是默认参数50: python app.py

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