0

My android application needs to draw Waveform for the audio recorded as raw pcm using AudioRecord class. I went through the source code of opensource project RingDroid , which shows waveform and process audio in android, but i couldn't understand anything as it is complicated one.

Please show me some code that draw waveform from pcm data.

Raneez Ahmed
  • 3,808
  • 3
  • 35
  • 58

1 Answers1

2

There is an Android class called Visualizer that lets you access audio.

Visualizer can not only access the "live" audio output mix but also the audio from a particular MediaPlayer or AudioTrack

http://developer.android.com/reference/android/media/audiofx/Visualizer.html

There is a live wallpaper that uses Visualizer to show the audio output mix but this could be adapted to use audio from a MediaPlayer or AudioTrack
https://android.googlesource.com/platform/packages/wallpapers/MusicVisualization/+/master/src/com/android/musicvis

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • Does anyone understand what the Visualizer shows? I fail to see anything information in those animations, as opposed to a proper waveform. – Luis A. Florit May 20 '22 at 00:27