本文介绍了停止在pydub中播放音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在pydub中是否有终止或停止功能之类的功能,使得通过play()启动后的流可以在其仍在播放时突然停止,而不是在音频播放到其全长后停止.

Is there something like terminate or stop feature in pydub such that the stream after started by play() can be stopped abruptly while it is still playing instead of the audio being played to it's full length and then stopping.

推荐答案

您可以在pydub的播放文件中使用多线程播放/暂停,甚至停止音乐.

you can use Multithreading in the playback file of pydub to play/pause and even stop the music .

在此处检查文件,并用

https://github.com/NeelRanka/pydub_edited_play-pause-stop.git

这篇关于停止在pydub中播放音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-10 22:35