Python库的文件转换成MP3和设置它们的质量 [英] Python library for converting files to MP3 and setting their quality

查看:203
本文介绍了Python库的文件转换成MP3和设置它们的质量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到将采取的音频文件一个Python库(例如.OGG,.WAV)并将其转换成MP3播放在网页上。

I'm trying to find a Python library that would take an audio file (e.g. .ogg, .wav) and convert it into mp3 for playback on a webpage.

此外,在制定其质量进行播放任何想法将是巨大的。

Also, any thoughts on setting its quality for playback would be great.

感谢您。

推荐答案

看起来PyMedia做到这一点:

Looks like PyMedia does this:

http://pymedia.org/

和这里一些更多的信息在转换为各种格式,同时设置比特率:

and some more info here on converting to various formats, whilst setting the bitrate:

http://pymedia.org/tut/re$c$c_audio。 HTML

例如

params= {
'id': acodec.getCodecId('mp3'),
'bitrate': r.bitrate,
'sample_rate': r.sample_rate,
'ext': 'mp3',
'channels': r.channels }
enc= acodec.Encoder( params )

这篇关于Python库的文件转换成MP3和设置它们的质量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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