简体   繁体   English

使用java声音实时处理音频和绘制波形

[英]manipulating audio and drawing waveform using java sound in real-time

I am currently developing an application that helps the user to tune his guitar and generate guitar effects. 我目前正在开发一个应用程序,帮助用户调整他的吉他并生成吉他效果。 This is in real-time. 这是实时的。 I've been looking through java applications that could give an idea to generate guitar effects such as overdrive and delay but I couldn't find any. 我一直在寻找能够产生吉他效果的java应用程序,例如过载和延迟,但我找不到任何东西。 Also a source on creating a waveform in real time is needed. 还需要实时创建波形的源。 Your comments would be so much help, thanks in advance. 您的意见将非常有用,感谢提前。

John says: 约翰说:

First, forget Java ... Secondly, you will be interfacing with the hardware ... Java does not support this kind of thing. 首先,忘记Java ......其次,你将与硬件接口...... Java不支持这种事情。

Jeez, that's kinda harsh - you should have told Sun that this wasn't possible before they published the API for this: http://java.sun.com/products/java-media/sound/ . Jeez,这有点苛刻 - 你应该告诉Sun,在他们发布这个API之前,这是不可能的: http//java.sun.com/products/java-media/sound/ There's lots done with sound in Java, and I've never had an issue with latency or buffers, even on somewhat decrepit hardware. 在Java中有很多声音,我从来没有遇到过延迟或缓冲的问题,即使在有些破旧的硬件上也是如此。

Good examples @ http://www.jsresources.org/examples/index.html 好的例子@ http://www.jsresources.org/examples/index.html

Good help @ http://java.sun.com/products/java-media/sound/list.html 很好的帮助@ http://java.sun.com/products/java-media/sound/list.html

... having said that, John's comments on learning DSP & waveform analysis are on the $$$. ......话虽如此,John对学习DSP和波形分析的评论都在$$$上。

Have fun - Dave 玩得开心 - 戴夫

This open source project maybe a good reference for you. 这个开源项目可能是一个很好的参考。 There's a function that construct the waveform http://code.google.com/p/musicg/ 有一个函数可以构建波形http://code.google.com/p/musicg/

Regarding the feasability of low latency sound processing: Have a look at this article about Harmonicon, a java soft-synth . 关于低延迟声音处理的可行性 :看看这篇关于Harmonicon的文章,这是一个java软合成器 It's a sample playing synth implemented entirely in java, using the Metronome GC , which has upper latency guaranties in < 2 ms running on a realtime OS. 这是一个完全用Java实现的合成器示例,使用Metronome GC ,它在实时操作系统上运行<2 ms,具有较高的延迟保证。

Regarding wave form generation/dsp , check out the example in this question, Java generating sound , a very simple wave form generation example. 关于波形生成/ dsp ,请查看此问题中的示例, Java生成声音 ,一个非常简单的波形生成示例。

First, forget Java. 首先,忘记Java。 Java is a managed run-time which does garbage collection. Java是一个托管运行时,可以进行垃圾回收。 When this happens you will hear shuttering because you wanna keep your sound buffer small to minimize latency, 当发生这种情况时,你会听到模板,因为你想保持你的声音缓冲区很小,以减少延迟,

Secondly, you will be interfacing with the hardware ie sound card, Java does not support this kind of thing and so you'll either have to write some hardware abstraction in JNI or find an existing solution, but there's a problem with that to. 其次,你将与硬件连接,即声卡,Java不支持这种事情,所以你要么必须在JNI中编写一些硬件抽象或者找到现有的解决方案,但是有一个问题。 It's unlikely that you'll get the real-time performance from the Java platform. 您不太可能从Java平台获得实时性能。

What you wanna do is that you wanna go with C++ for this, and you will wanna learn more about partial-differentiation, DSP, sound synthesis and waveform analysis. 你想做的是你想用C++来做这件事,你会想要了解更多关于偏微分,DSP,声音合成和波形分析的知识。 This is quite a lot to take on but it should give you a good sense of direction if you start reading up on relevant research... 这是相当多的事情,但如果你开始阅读相关的研究,它应该给你一个很好的方向感......

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

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