I'm looking for a way to create a audio bars visualizer similar to this in iOS.
Every white bar will move up and down depending of audio wave. I'm really lost because haven't much experience dealing with audio in Objective-c.
EDIT: What i'm seeking is what Overcast's app does on its visualizer (the group of vertical orange bars on the lower part of the podcast's image)
Anyone can help? Thanks
EDIT: Thanks to Tomer's answer I finally made it. First I did this tutorial in order to make it all clear. Then I created my own VisualizerView for my project, you can find it in this gist. Maybe is not perfect but it does what I needed to do.
Enjoy music at a deeper level with realtime visualization! Spectra is a lightweight music & audio visualizer app that allows you to select and visualize audio in realtime, right on your phone or mac.
Use the visualizer to watch colorful light shows. You can use the visualizer with or without music; the effects change based on the type of music and whether it's playing or paused. In the Music app on your Mac, do any of the following to play music: Stream songs from Apple Music.
Generally, you have a few options if you want to get an idea of what something sounds like in iOS:
AVAudioPlayer
audio player, and then use the [audioPlayer averagePowerForChannel:]
method to get the avarage audio level for the current moment. Check out this tutorial.EDIT: The standard way of doing such a thing is to use the Fast Fourier Transform (FFT) - it extracts frequency information from a sound. Here's a good example of using it on iOS (Apple's guide here). But, of course, to use it you have to know exactly what waveform you're playing every time, so you'd probably want to use a lower-level API such as Audio Queue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With