如何从文本文件创建 wav 文件?
我有一个文本文件,它存储 wav 文件的频率和部分的持续时间,例如:
44100hz 150 010 150 015 133...
这些信息描述了将使用44100hz频率创建wav文件,音量100时50ms,音量0时10ms,音量100时50ms,音量0时15ms,音量100时33ms...我不知道知道如何设置写入 wav 文件时的持续时间。 “数据数组”中的元素是否存储(1/频率)秒的幅度?你能帮助我吗?
p/s: 很抱歉我的英语不好,我正在使用 C# 编码。
I have a textfile, it stores the frequency and parts' durations of a wav file for example:
44100hz
150 010 150 015 133...
These informations describe the wavfile will be created with 44100hz of frequency, 50ms with volume 100, 10ms with volume 0, 50ms with volume 100, 15ms with volume 0 and 33ms with volume 100... I dont know how to set the duration when I be writing wav file. Does an element in 'data array' store amplitude of (1/frequency) seconds? Can you help me?
p/s: I'm sorry about my English, I am using C# to code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认识自己,但 Garrett Hoofman 创建了用于创建的包装器C# 中的 WAV 文件。
通过获取数据,您应该能够使用 生成MSDN 上的声波与 C# 波振荡器,用于实际从文件创建数据。
这是 Garret 的 WaveLibrary 库中的 WAV 文件规范。
I don't know myself, but Garrett Hoofman created a wrapper for creating WAV files in C#.
By taking your data you should be able to use Generating Sound Waves with C# Wave Oscillators on the MSDN to actually create the data from your file.
Here is the WAV File spec from the Garret's WaveLibrary library.