如何在PyGame中更改频道量后节省声音

发布于 2025-02-06 14:10:25 字数 309 浏览 0 评论 0 原文

在此之后,我想“保存”音乐。 我的代码就是这样:

from pygame import mixer
import time

mixer.init()
sound0 = mixer.Sound('Prison.mp3')
channel0 = mixer.Channel(0)
channel0.play(sound0)
channel0.set_volume(1.0, 0.0)

time.sleep(sound0.get_length())

在此之后,音乐只是在左频道中播放,在右频道中播放什么都没有播放。 现在我想保存这种音乐。谢谢

I want to 'save' music after that I changed the channel volume.
My code is like this:

from pygame import mixer
import time

mixer.init()
sound0 = mixer.Sound('Prison.mp3')
channel0 = mixer.Channel(0)
channel0.play(sound0)
channel0.set_volume(1.0, 0.0)

time.sleep(sound0.get_length())

after this the music just play in left channel and in right channel nothing go to play.
Now I want to save this music. thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅暮の光 2025-02-13 14:10:25

在这种情况下,我认为您应该使用另一个软件来减少音频文件以在左通道中播放,只能

通过遵循以下步骤:

  1. 在Audacity中打开您的音频文件。
  2. 移动第二个滑块请参见图像仅有的。
  3. 导出您的音频。

In this case I think you should use another software to minipulate your audio file to play in left channel only

you can easily do that in audacity by following these steps:

  1. open your audio file in audacity.
  2. move the second slider see image all the way to the left to make audio come out from left channel only.
  3. export your audio.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文