的MP3单声道播放在Python或C ++ [英] Mono Playback of Mp3s in Python OR C++

查看:256
本文介绍了的MP3单声道播放在Python或C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时通讯使用的PyQt和我编写一个音乐播放器希望它配备了MP3文件的单声道播放。

Im coding a music player in python using pyqt and I wanted it to feature mono playback of mp3 files.

我已经完成,使用pygame的,因为它的混频器具有特定参数频道,我可以设置为 1 获得单声道播放。

I've accomplished that using pygame, as its mixer has a specific parameter channels that I can set to 1 to get mono playback.

不过,pygame的 MP3支持是有限的的,所以我在寻找一个库这将能够处理MP3文件和单声道播放。

However, pygame mp3 support is limited, so I'm searching for a library that will be able to handle mp3 files AND mono playback.

目前,我使用pyaudiere播放并在其网站有打之前处理歌曲的例子,所以也许我能做到这一点打开歌曲为单声道,但我真的不知道如何来实现这一目标。

Currently, I'm using pyaudiere for playback and on its site there's an example of processing the song before playing it, so maybe I could do that to turn the song to mono, but I really have no idea how to accomplish that.

我想就如何使用pyaudiere或可处理mp3文件的任何其他库code此功能的帮助。

I'd like help on how to code this feature using pyaudiere or any other library that can handle mp3 files.

修改

我也愿意接受C ++中的解决方案,因为我可以用总建一个Python包装的boost ::蟒蛇

I would also accept a solution in C++, as I can always build a python wrapper using Boost::python

推荐答案

如果你想真正的好Windows的支持我怀疑你可能需要或者发现它更容易使用不同的API为Windows ...检查这些链接:

IF you want really good Windows support I suspect you might need or find it easier to use a different API for Windows... check these links:

  • http://people.csail.mit.edu/hubert/pyaudio/ (cross-platform)
  • http://ffmpeg.org/ffmpeg.html (cross-platform)
  • http://www.codeproject.com/KB/audio-video/MP3Example.aspx (Windows-specific)
  • http://msdn.microsoft.com/en-us/library/windows/desktop/dd743572%28v=vs.85%29.aspx (Windows-specific)

编辑 - 最有可能的解决方案(到目前为止的意见是pretty正面):

EDIT - most probably the solution (so far the comments are pretty positive):

另一个选择是 http://www.un4seen.com/bass.html (当心:商业) - 它所有你要的,是免费的非商业用途,有一个Python包装(称为pybass)...

Another option is http://www.un4seen.com/bass.html (beware: commercial) - it does all you asked for, is free for use in non-commercial applications and there is a python wrapper (called pybass)...

这篇关于的MP3单声道播放在Python或C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆