Search code examples
androidaudiographaudio-recordingmpandroidchart

Plotting android recording samples's amplitude on moving graph RealTime


I'm developing a recording app, for which I am trying plot amplitude of audio recording samples against time on Android View similar to below image.

The graph should move with time towards the left side of the screen.

enter image description here

I tried using LineChart of MPChart Library but still, the result is not as expected.

MPChart homepage has a screenshot of such graph, but couldn't figure it how to implement.

Please help. Thank you.


Solution

  • You can use LineChart for that, here is official RealtimeLineChartActivity:

    Oficial RealtimeLineChartActivity example

    Like in the sample, you should feed (feedMultiple method) it with data from other Thread, periodically (Runnable)

    Hope that helps