How to draw a graph of sounds while recording in java sound?

人盡茶涼 提交于 2019-12-08 05:26:54

问题


I successfully recording java sounds from my micro phone and can draw the recorded wave file graph as in attached image. (I have tried to upload image from here a lot, but it is failed every time.i also used tinypic also but failed in uploading , i think there is some error in my internet connection, i will upload it later here. )

I am also attaching all my code. http://pastebin.com/EgW2ZcyJ

Now, my question is i want to display Graphs for the sound while recording in real time .so if i try to read audio input stream which is used in recording in new thread and sleep this thread for 1 seconds until the recording is finished . but in this approach it gives frame length -1 so nothing can be drawn.

so how can i draw a graph means how can i get frames of recorded sound [bytes from audio input stream] while recording in real time , so i can use it to draw a graph using it in different thread so i can exactly simulate what window's sound recorder provides ??

Thank You Mihir Parekh


回答1:


This example uses JFreeChart to display recent changes to a time-based series.

Sorry, but you don't understand my question.

Addedndum: You can edit your question to clarify; this will also help guide future answers. In the interim, you might be able to adapt TeeOutputStream to intercept the OutputStream from AudioSystem.write().



来源:https://stackoverflow.com/questions/12035799/how-to-draw-a-graph-of-sounds-while-recording-in-java-sound

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