0

I am planning to write an app that can play the songs from the user's music library (such as Spotify & Apple Music) while carrying beat tracking.

The end goal is to show a music visualizer like this:

enter image description here

Is it possible to read the full song in advance? So I can adjust the UI accordingly e.g. change theme depending on the genre of the song.

If so, what are the steps of implementing that?

paulina_glab
  • 2,467
  • 2
  • 16
  • 25
xyz.dev
  • 3
  • 2
  • _"a music visualizer like this"_ what's beat tracking? Did you mean _beat detection_? That is used to determine BPM / tempo. For such a visualizer you need to access the sound samples (called PCM). Extract what you need per second (eg: 44100) and calculate frequencies using FFT algorithm. Try something [from research](https://www.google.co.uk/search?hl=en-GB&q=android+get+pcm+samples). – VC.One Oct 19 '18 at 09:07
  • 1
    Before moving onto frequencies, I suggest a simpler task in a new blank project: **read PCM samples and draw them as [waveform](https://openclipart.org/image/800px/svg_to_png/195966/Soundwave-Dark.png)**. Once you get the vibe of working with samples, then you can move onto FFT to decide which is bass, mids or treble and draw a visual that animates at different sections according to low or high freq sounds. Then wrap visual (pixels) into a circular shape if you want that specific look. – VC.One Oct 19 '18 at 09:12

1 Answers1

1

You should use FFT for the beat detection. This is also described in various articles or projects where you can get an inspiration:

nestor10
  • 474
  • 4
  • 12