Pyglet使用AVBin来解码MP3.链接:http://avbin.github.com/AVbin/Download.html
使用install.sh安装,使用时会导致错误:
'AVbin is required to decode compressed media')
pyglet.media.riff.WAVEFormatException: AVbin is required to decode compressed media
Run Code Online (Sandbox Code Playgroud)
...所以它安装不正确?使用python virtualenv,怀疑这可能会导致问题...虽然我在virtualenv中运行了AVBin的install.sh,如下所示:
(SoundShenanigans)user@computer:~/Downloads/avbin-linux-x86-64-v8$ sudo bash install.sh
Run Code Online (Sandbox Code Playgroud)
UPDATE
我找到了安装avbin的地方......似乎安装在正确的位置= S.
~/pyvien/SoundShenanigans/lib/python2.7/site-packages/pyglet/media$ ls
avbin.py drivers __init__.pyc procedural.pyc riff.pyc
avbin.pyc __init__.py procedural.py riff.py
Run Code Online (Sandbox Code Playgroud)
更新2
该库是.so,而不是.dylib,为什么你想要.dylib神秘的代码?这是Linux而不是Mac(Mac有.dylib,Ubuntu有.so)
File "SoundShenanigans.py", line 4, in
from pyglet.media import avbin
File "/home/user/pyvien/SoundShenanigans/local/lib/python2.7/site-packages/pyglet/media/avbin.py", line 53, in
darwin='/usr/local/lib/libavbin.dylib')
File "/home/user/pyvien/SoundShenanigans/local/lib/python2.7/site-packages/pyglet/lib.py", line 122, in load_library
raise ImportError('Library "%s" not found.' % names[0])
ImportError: Library "avbin" not found.
Run Code Online (Sandbox Code Playgroud) 请帮助选择将任何mp3文件转换为特殊.wav的解决方案 - 我是Linux命令行工具的新手,所以现在对我来说很难.
我需要从任何mp3文件获得带有16khz单声道16bit声音属性的wav.我在努力
ffmpeg -i 111.mp3 -ab 16k out.wav,
但我得到的wav与mp3(22k)相同.
请帮助构建正确的命令行
我从互联网上找到了这个代码,它使用了Google翻译的文本到语音功能.这是代码:
http://translate.google.com/translate_tts?tl=en&q="hello world"
Run Code Online (Sandbox Code Playgroud)
我知道如何在我的vb.net中调用它,但我不知道如何从谷歌翻译中保存MP3文件.我使用vb.net中的system.speech来获得此功能,但我特别需要从谷歌翻译获得演讲.那么,有没有人知道如何使用该URL保存谷歌翻译的声音文件?谢谢.
我想为Android编译跛脚编码器.我怎样才能找到Lame的教程及其Android平台的编译.
谢谢,
当我直接从命令行运行sox时;
sox -r 8000 -c 1 <wavfilename> <mp3filename>
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息:
sox:'747a.mp3'的输出文件格式未知:文件类型'mp3'未知
我的机器正在运行CentOS操作系统.
有没有办法在PHP中自动将上传到网站的MP3修剪到30秒(或其他长度)?如果没有,是否有任何良好的第三方服务可以集成(对用户透明)以达到同样的效果?
谢谢.
我想发展如下,但我找不到好的例子:
我想玩而不必在网址中下载mp3编码.除非用户停止播放,否则mp3应该在后台播放.我想我做多任务处理.
请提供示例文档或任何建议.谢谢.
在不使用外部库的情况下,确定给定mp3文件的长度(以秒为单位)的最简单方法是什么?(蟒蛇来源高度赞赏)
我想将两个或多个.wav文件合并为一个,然后将其转换为.mp3,我想在Swift中完成(或者至少可以选择将它包含在swift项目中).
在swift中合并两个.wav文件不是问题.这是我的例子现在我不知道如何将lame库添加到swift项目以及如何使用它(如何更改客观的蹩脚代码使用语法以在swift中使用它).
我坚持使用swift,所以我尝试了使用Objective C的Lame库.我找到了将.caf转换为.mp3的示例代码,所以我试了一下.这是我尝试过的:
- (void) toMp3
{
NSString *cafFilePath = [[NSBundle mainBundle] pathForResource:@"sound" ofType:@"caf"];
NSString *mp3FileName = @"Mp3File";
mp3FileName = [mp3FileName stringByAppendingString:@".mp3"];
NSString *mp3FilePath = [[NSHomeDirectory() stringByAppendingFormat:@"/Documents/"] stringByAppendingPathComponent:mp3FileName];
NSLog(@"%@", mp3FilePath);
@try {
int read, write;
FILE *pcm = fopen([cafFilePath cStringUsingEncoding:1], "rb"); //source
fseek(pcm, 4*1024, SEEK_CUR); //skip file header
FILE *mp3 = fopen([mp3FilePath cStringUsingEncoding:1], "wb"); //output
const int PCM_SIZE = 8192;
const int MP3_SIZE = 8192;
short int pcm_buffer[PCM_SIZE*2];
unsigned char mp3_buffer[MP3_SIZE];
lame_t lame = lame_init();
lame_set_in_samplerate(lame, 44100); …
Run Code Online (Sandbox Code Playgroud)