将声音导出为 WAV 文件 [英] Exporting sounds as WAV files

查看:28
本文介绍了将声音导出为 WAV 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从来没有在 Mma 中过多地处理声音.

I never worked too much with sounds in Mma.

我有

t = Sound[List["Violin",SoundNote[-6]]]

如何将 t 导出为 .WAV 文件?

How could I Export t as a .WAV file?

当我尝试显而易见的事情

When I try the obvious

Export["c:\\test.wav",t]

我明白

在这个旧线程中 Szabolcs说做不到.也许自 2007 年以来情况有所改善!

In this old thread Szabolcs said that it can't be done. Perhaps things have improved since 2007!

推荐答案

我觉得还是做不到.Mathematica 支持创建和修改 MIDI 对象,但将声音生成从MIDI 到底层操作系统.目前,您必须导出为 MIDI,然后使用系统上的 MIDI 接口或在线服务转换为采样声音格式.

I think that it still can't be done. Mathematica supports creating and modifying MIDI objects, but leaves the sound generation from the midi to the underlying operating system. For now, you'll have to export to midi then use the midi interface on your system or an online service to convert to a sampled sound format.

例如(来自文档)

t = Sound[SoundNote[DeleteCases[3 Range[31] Reverse[#], 0] - 48, .1] & /@ 
   Transpose[CellularAutomaton[90, {{1}, 0}, 30]]]
Export["test.mid", t]

上传到 http://free-midi-converter.com/Midi/Create 给出了链接.

它还可以使用 TiMidity 进行转换,该命令在所有主要操作系统上都可用命令(假设你已经运行了上面的)

It can also be converted with TiMidity which is available on all major operating systems with the command (assuming you've run the above)

Run["timidity test.mid -Ow -o test.wav"]

可以使用 Import["test.wav"] 导入回 Mathematica.

which can be imported back into Mathematica using Import["test.wav"].

如果需要,这种转换可以自动化...

This conversion can be automated if need be...

显然VLC 也可以将 midi 转换为 wav,这可能是一个一些专有操作系统更简单的选择!另请参阅此处给出的选项.

Apparently VLC can also convert midi to wav, which might be an easier option for some propriety operating systems! See also the options given here.

这篇关于将声音导出为 WAV 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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