-2

I am developing an Android application,which can take audio input from device mic and generate a graph in real time as an output.For generating a Graph on a view I am using GraphView library. I am trying to convert a .wav audio file into an array.But I don't know where I have to use this array for drawing a graph?

Adarsh Yadav
  • 3,752
  • 3
  • 24
  • 46
Adib
  • 11
  • 3
  • 1
    What have you tried so far ? If you have code, please paste it here for others to look at. – Alaa Mahmoud Jul 06 '17 at 15:26
  • i found this : 1 - create a WaveSimple (time, amplitude); – Adib Jul 07 '17 at 09:52
  • I have updated misleading description as well as title. Now anyone can easily understand what exactly the question is. Thanks. – Adarsh Yadav Jul 07 '17 at 10:11
  • @Adib Which library you are using for drawing graph? If it is http://www.android-graphview.org/download-getting-started/ then you can easily find mutiple samples on the same link. – Adarsh Yadav Jul 07 '17 at 10:13
  • @AdarshYadav I want to use GraphView library, but i din't know what it not working. if you want i can show you my code – Adib Jul 07 '17 at 12:49

1 Answers1

0

i found this : 1 - create a WaveSimple (time, amplitude) then i creat a Liste to add samples in this Liste;

Liste<WaveSample> pointListe = new ArrayListe<>();

and when i start recording i put this :

pointList.add(new WaveSample (Time, myAudioRecord.getMaxAmplitude ());

i want to create a lineGraph with this List but i couldn't ; this what i write :

for(int i = 0; i<pointList.size(); i++){
    x = (double) pointList.getTime();
    y = (double) pointList.getAmplitude();
   series.appendData(new DataPoint(x, y),true,pointList.size())
   }

but doesnt work

Adib
  • 11
  • 3