1

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

Mihir
  • 2,480
  • 7
  • 38
  • 57

1 Answers1

2

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().

image

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • I think Mr. trashgod did not understand my question yet. i am not looking for how to draw a graph , i am looking for first how to retrieve recorded bytes simultaneously which is in audio input stream being filled from target data line i choose and from those bytes i will draw a graph.so drawing graph is not an issue here. – Mihir Aug 20 '12 at 11:10
  • Sorry, I'm unfamiliar with the `com.actura.app.capture` API. – trashgod Aug 20 '12 at 11:32
  • did you see the link ? it is very simple . i am concern with only run method of that class . once i get bytes from that i can draw the graph in real time of captured voice. – Mihir Aug 20 '12 at 11:38
  • Yes, I saw the link. What method? What bytes? The `appendData()` method in the example accepts an array of bytes. – trashgod Aug 20 '12 at 11:51
  • sorry but you don't understand my question. – Mihir Aug 20 '12 at 12:26