如何用 Julia 语言播放任何波形的音频? [英] How to play any waveform's audio in julia language?

查看:16
本文介绍了如何用 Julia 语言播放任何波形的音频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个长度为 5 秒的正弦曲线,如下所示:

I have a sinusoid with length 5 seconds as below:

x=sin(0:.01:2*pi*500*5);

现在我想通过给出类似如下的命令来听到这个波形的音频:

Now I would like to hear the audio of this waveform by giving a command similar as below:

playsound(x,samplingfrequency);

如果我可以将此音频数据写入 wav 或 mp3 文件,这对我很有用.这个功能需要什么库和 julia 中的等效命令?

It will be useful for me if I could write this audio data to a wav or mp3 file. What is the library needed and the equivalent command in julia for this functionality?

推荐答案

您可以使用 https:///github.com/ssfrr/AudioIO.jl

对于写/读 wav https://github.com/JuliaLang/Sound.jl/blob/master/src/Sound.jl

不过目前这两个模块都处于早期阶段.

However at this time both modules are in early stage.

这篇关于如何用 Julia 语言播放任何波形的音频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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