wav文件操作 [英] wav file manupalation

查看:31
本文介绍了wav文件操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将波形的详细信息(例如其帧)转换为整数数组.使用 fname.getframes 我们可以获取框架的属性并保存在列表或任何内容中以写入另一个 wav 或任何内容,但 fname.getframes 提供的信息不是整数,例如/xt/x4/0w"等.

I want get the details of the wave such as its frames into a array of integers. Using fname.getframes we can ge the properties of the frame and save in list or anything for writing into another wav or anything,but fname.getframes gives information not in integers some thing like a "/xt/x4/0w' etc..

但我希望它们是整数,以便于操作和平滑连接 2 个 wav 文件

But i want them in integer so that would be helpful for manupation and smoothening join of 2 wav files

推荐答案

如果您需要将帧数据转换为整数,您可以创建一个array.array('h')(带符号的 16 位字数组)和使用它的 .fromstring.fromfile 方法.

If you need to convert the frame data into integers, you can create an array.array('h') (array of signed 16-bit words) and load it from the frame data using its .fromstring or .fromfile methods.

但是,我几乎可以肯定您可以保持帧数据原样,并使用 audioop 模块.

However, I'm almost sure that you can keep the frame data as they are, and manipulate them using functions in the audioop module.

这篇关于wav文件操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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