bastienFalcou / SoundWave

Illustrate your sound waves on the fly 🚀
MIT License
596 stars 93 forks source link

Waves not showing while playing uploaded songs #36

Open JustinJusz opened 5 years ago

JustinJusz commented 5 years ago

Waves are not showing correctly . I am using the code shows below ` self.audioVisualizationView.gradientStartColor = .audioVisualizationPurpleGradientStart self.audioVisualizationView.gradientEndColor = .audioVisualizationPurpleGradientEnd //self.audioVisualizationView. // Do any additional setup after loading the view. self.audioVisualizationView.audioVisualizationMode = .read self.audioVisualizationView.meteringLevels = [0.1, 0.67, 0.13, 0.78, 0.31] //self.audioVisualizationView.scaleSoundDataToFitScreen()

    guard let url = Bundle.main.url(forResource: "Aln", withExtension: "mp3") else { return }
     self.audioPlayer = AVAudioPlayer(contentsOf: url)
    self.audioVisualizationView.play(for: self.audioPlayer!.duration)

`

Is the correct way.. ?

Screenshot 2019-04-02 at 2 33 29 PM

bastienFalcou commented 5 years ago

Hello @JustinJusz!

If I understand correctly, you are trying to play the representation of Aln.mp3 on the AudioVisualizationView correct?

This feature is unfortunately not supported at the moment, although it has been the #1 request so far. It will be implemented in priority 👍

Duplicate of #11 and #28. I will keep you updated once it is supported!