I need to draw wave forms of audio files. It has to be scalable horizontally and vertically.
Using @stevel05 's WavRandomAccessFile, I can get the raw data and visualize it using a java plot library:
I prefer to use a B4X implementation and xGraph by @klaus seems a good option. But I cannot figure out how to use it. Any direction would be appreciated.
Using @stevel05 's WavRandomAccessFile, I can get the raw data and visualize it using a java plot library:
B4X:
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
wavRaf.Initialize(File.DirApp,"segment-00006.wav")
Dim data() As Double = wavRaf.DataDoubles
Dim jo As JavaObject = Me
jo.RunMethod("plot",Array(data))
End Sub
#if java
import com.sin.java.plot.Plot;
import com.sin.java.plot.PlotFrame;
public static void plot(double[] data) {
PlotFrame frame = Plot.figrue("WaveForm");
frame.setSize(500, 200);
Plot.hold_on();
Plot.plot(data);
Plot.hold_off();
}
#End If
I prefer to use a B4X implementation and xGraph by @klaus seems a good option. But I cannot figure out how to use it. Any direction would be appreciated.
Last edited: