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

1

2

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

Latonya answered 20/8, 2012 at 10:10 Comment(1)
I won't follow the link to 'all your code'. For better help sooner, post an SSCCE.Pola
M
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

Mccormick answered 20/8, 2012 at 10:18 Comment(5)
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.Latonya
Sorry, I'm unfamiliar with the com.actura.app.capture API.Mccormick
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.Latonya
Yes, I saw the link. What method? What bytes? The appendData() method in the example accepts an array of bytes.Mccormick
sorry but you don't understand my question.Latonya

© 2022 - 2024 — McMap. All rights reserved.