如何使用Python连接两个wav文件? [英] How to join two wav files using python?

查看:1774
本文介绍了如何使用Python连接两个wav文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是用Python编程语言,我想加入到wav文件逐一其他wav文件的结尾?
我在论坛中发帖提问这表明如何合并两个wav文件即在一定添加一个wav文件的内容偏移,但我想连接两个wav文件互相年底...

I am using python programming language,I want to join to wav file one at the end of other wav file? I have a Question in the forum which suggest how to merge two wav file i.e add the contents of one wav file at certain offset,but i want to join two wav file at the end of each other...

和也我有一个概率打我自己的wav文件,使用广州市运生module..I能够播放声音,但使用一段时间的time.sleep玩够之前的任何Windows声音,缺点机智这是,如果我想播放声音不再THN time.sleep(N),N秒还,N秒后Windows声音WIL JST重叠发挥广州市运生第二停止。

And also i had a prob playing the my own wav file,using winsound module..I was able to play the sound but using the time.sleep for certain time before playin any windows sound,disadvantage wit this is if i wanted to play a sound longer thn time.sleep(N),N sec also,the windows sound wil jst overlap after N sec play the winsound nd stop..

谁能帮助?请您建议如何解决这些概率...

Can anyone help??please kindly suggest to how to solve these prob...

在此先感谢

推荐答案

您可以使用 AUDIOLAB的

import audiolab, scipy
a, fs, enc = audiolab.wavread('file1.wav')
b, fs, enc = audiolab.wavread('file2.wav')
c = scipy.vstack((a,b))
audiolab.wavwrite(c, 'file3.wav', fs, enc)

这篇关于如何使用Python连接两个wav文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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