Python将stereo.flac转换为mon

2024-05-13 07:11:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我正努力在Python中操纵音频通道。具体来说,如何在Python中将stereo.flac转换成mono.flac文件?在

我知道这个方法: https://trac.ffmpeg.org/wiki/AudioChannelManipulation#stereomonostream 但是我在寻找可以直接用Python完成的东西。在

如有任何帮助,将不胜感激。在


Tags: 文件方法httpsorgwiki音频ffmpeg中将
1条回答
网友
1楼 · 发布于 2024-05-13 07:11:49

你试过ffmpeg-python包吗?在

您可以使用pip install ffmpeg-python安装它。并可能解决您的问题:

import ffmpeg
ffmpeg.input('stereo.flac').output('mono.flac', ac=1).run()

GitHub存储库中有一些examples。在

另一个选择是使用subprocess模块:

^{pr2}$

使用shell=True时要小心。在

相关问题 更多 >