简体   繁体   中英

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? I need it to be very precise. What about matlab? Which language would be best for this task. The language must have a GUI component.

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 .

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.

Also, take a look at 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

Thanks to @Andrew for once again correcting me.

In MATLAB, just use the SOUND function:

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 . There is API for java.

You should also check this wiki page: 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

on windows actually any language can emit a sound just outputting ascii character "\\007". Here is a nice article about how to do it in java.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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