How to capture Audio data in Java

时间秒杀一切 提交于 2019-12-10 19:50:09

问题


I want to access the audio data that my microphone is recording with Java. How would I do that?

My goal is to save the audio data that is recorded and simultaneously play it to the user.


回答1:


If you don't need any of the additional functionality in JMF, I would avoid it since development has ceased (last version is from 2004), it has compatibility issues with Java 6, has a very restricted functionality in 64-bit VMs and has to installed as a separate extension library.

Audio recording, playback and a few simple media formats are supported directly by JavaSound (javax.sound), which is part of the standard Java API.




回答2:


Have a look at the Java Media Framework

The Java Media Framework API (JMF) enables audio, video and other time-based media to be added to applications and applets built on Java technology. This optional package, which can capture, playback, stream, and transcode multiple media formats, extends the Java 2 Platform, Standard Edition (J2SE) for multimedia developers by providing a powerful toolkit to develop scalable, cross-platform technology.

It should have all you need.



来源:https://stackoverflow.com/questions/2265574/how-to-capture-audio-data-in-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!