根据振幅样本创建音频文件 [英] Create audio file from samples of amplitude

查看:98
本文介绍了根据振幅样本创建音频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个采样幅度为(0-26522)的文本文件,如何从中创建可播放的音频文件?

If I have a text file of sample amplitudes (0-26522), how can I create a playable audio file from them?

我回想起对.pcm文件和8位样本进行修补的模糊回忆.

I have a vague recollection of tinkering with .pcm files and 8-bit samples way back in the nineties.

是否有任何软件可以从样本中自动创建音频文件(PCM或其他格式)?我找到了 SoX ,但是即使在查看了文档之后,我仍然无法确定它是否可以做什么我想要,如果可以的话...

Is there any software to automatically create an audio file (PCM or other format) from my samples? I found SoX, but I even after looking at the documentation I can't figure out if it can do what I want, and if so how...

推荐答案

GUI音频工作站称为 Audacity 让您做到这一点

GUI audio workstation called Audacity that lets you do this

文件->导入->原始数据

File -> Import -> Raw Data

Encoding:   Signed 16-bit PCM    // even though your ints are unsigned it still works
Byte order:  little endian
Channels     1 channel mono

然后只需点击导入

为了确认这项工作,在文本编辑器中,我对以下整数列表进行了10次剪切(剪切N糊,然后选择所有的糊,粘贴,粘贴,粘贴),以在垂直列中生成几千个整数. ..这是我的玩具输入文件...在导入之后,只需通过

to confirm this works, in a text editor I just did a ( cut N paste followed by select all paste,paste,paste,paste ) of below list of ints about 10 times to generate several thousand ints in a vertical column ... this is my toy input file ... after above Import just save by doing

文件->导出音频

在执行此操作后,您可以在其中选择哪种输出格式(mp3,aac,PCM等),输出mp3是可播放的...使用玩具输入文件,我确实听到了正弦音

where you choose which output format ( mp3, aac, PCM, ...) once I did this the output mp3 is playable ... using my toy input file I did hear a sine tone

3
305
20294
11029
585
3
305
20294
11029
585
3
305
20294
11029
585

这篇关于根据振幅样本创建音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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