0

I found how to create Sound wave From FDWaveformView Pods , but I can't modify to create a this type of wave screenshot below:

Here is what I am trying to do:-

Screen Shot One

The screenshot is taken from iPhone:-

Screen Shot Second

This code creates sine wave but I need to create pulse waves:-

    soundWaveView.delegate = self
    soundWaveView.alpha = 0.0
    soundWaveView.audioURL = mainTrackURL
    soundWaveView.zoomSamples = 0 ..< soundWaveView.totalSamples / 3
    soundWaveView.doesAllowScrubbing = false
    soundWaveView.doesAllowStretch = false
    soundWaveView.doesAllowScroll = false
    soundWaveView.wavesColor = UIColor(red: 46/255, green: 188/255, blue: 191/255, alpha: 1)
    soundWaveView.progressColor = UIColor(red: 251/255, green: 237/255, blue: 101/255, alpha: 1)
    do {
        try AVAudioSession.sharedInstance().setActive(true)
        playerSoundWave = try AVAudioPlayer(contentsOf: mainTrackURL!, fileTypeHint: AVFileType.mp4.rawValue)
        songTotalTime = Double((playerSoundWave?.duration)!)
    }
    catch let error {
        print(error.localizedDescription)
    }

Question: How to modify or create sound wave?

Can someone please explain to me how to create and modify sound wave, i've tried to modify but no results yet. Any help would be greatly appreciated.

Thanks in advance.

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
Sham Dhiman
  • 1,348
  • 1
  • 21
  • 59
  • Same as your (now deleted) https://stackoverflow.com/questions/74302422/change-sound-wave-swift and suffers from the same issues. The first drawing is easy to achieve; if a certain pod doesn't produce it, then just don't use that pod. To draw samples as vertical bars, simply draw samples as vertical bars (as in my https://stackoverflow.com/a/34971095/341994 for instance). – matt Nov 03 '22 at 11:53
  • @matt, ok thanks for sharing this, I will check and update you shortly. – Sham Dhiman Nov 03 '22 at 12:41

0 Answers0