简体   繁体   English

什么是声音控制语言

[英]What is a language for sound control

I'm trying to make a program that roughly does the following: 我正在尝试制作一个大致执行以下操作的程序:

produceBeepSound(double loudness);

can I do such a thing in Java? 我可以在Java中做这样的事情吗? I need it to be very precise. 我需要非常精确。 What about matlab? 那matlab呢? Which language would be best for this task. 哪种语言最适合此任务。 The language must have a GUI component. 该语言必须具有GUI组件。

You can use Java Media Framework to produce sound but it is not necessary because you can work with javax.sound.sampled package and integrate it with Java Swing . 您可以使用Java Media Framework产生声音,但这不是必需的,因为您可以使用javax.sound.sampled包并将其与Java Swing集成。

In python take a look at pyaudio library and also take a look at PythonInMusic it has a whole lot of collection of various A/V module. 在python中,请查看pyaudio库,同时还要查看PythonInMusic,它具有大量各种A / V模块的集合。

Also, take a look at Beeper . 另外,看看Beeper

It is a GUI program, using only J2SE classes, that can produce a sound of configurable tone & duration, and (with a bit of tweaking) at different raw volumes 这是一个GUI程序,仅使用J2SE类,可以产生可配置的音调和持续时间的声音,并且(通过一些调整)可以在不同的原始音量下进行

Thanks to @Andrew for once again correcting me. 感谢@Andrew再次纠正我。

In MATLAB, just use the SOUND function: 在MATLAB中,只需使用SOUND函数:

http://www.mathworks.com/help/techdoc/ref/sound.html http://www.mathworks.com/help/techdoc/ref/sound.html

You can specify a vector which represents your signal, and the amplitude on that vector will determine loudness, so its a matter of simple scaling. 您可以指定一个代表信号的矢量,并且该矢量上的振幅将确定响度,因此只需进行简单缩放即可。

you can try Csound . 您可以尝试Csound There is API for java. 有用于Java的API。

You should also check this wiki page: http://en.wikipedia.org/wiki/Comparison_of_audio_synthesis_environments . 您还应该检查以下Wiki页面: http : //en.wikipedia.org/wiki/Comparison_of_audio_synthesis_environments

But if you need somthing simple you can try: 但是,如果您需要简单的东西,可以尝试:

java.awt.Toolkit.beep();

or 要么

System.out.println((char)7);

But you won't have volume control. 但是您将没有音量控制。

Probably my favourite approach would be HTML 5 audio api - https://wiki.mozilla.org/Audio_Data_API#Writing_Audio 我最喜欢的方法可能是HTML 5音频api- https://wiki.mozilla.org/Audio_Data_API#Writing_Audio

on windows actually any language can emit a sound just outputting ascii character "\\007". 在Windows上,实际上只要输出ascii字符“ \\ 007”,任何语言都可以发出声音。 Here is a nice article about how to do it in java. 是一篇有关如何在Java中执行操作的不错的文章。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM