dmrschmidt / DSWaveformImage

Generate waveform images from audio files on iOS, macOS & visionOS in Swift. Native SwiftUI & UIKit views.
MIT License
978 stars 109 forks source link

Set progress of WaveformImageView #56

Closed shuuja closed 1 year ago

shuuja commented 1 year ago

Hi I am using WaveformImageView to show waveform of my audio file, and i am using AvAudioPlayer to play the audio. how can i set progress of the waveform when the audio is playing?

guard let url = Bundle.main.url(forResource: "OriginalRecording", withExtension: "m4a") else { return }

    middleWaveformView.configuration = Waveform.Configuration(
        backgroundColor: .lightGray.withAlphaComponent(0.1),
        style: .striped(.init(color: UIColor.red, width: 2, spacing: 1)),
        verticalScalingFactor: 0.5
    )
    middleWaveformView.waveformAudioURL = url
dmrschmidt commented 1 year ago

Please check the example and related issue that is linked in the readme: https://github.com/dmrschmidt/DSWaveformImage#playback-progress-indication On 10. Jan 2023 at 15:25 +0530, Shuja Ud Din @.***>, wrote:

Hi I am using WaveformImageView to show waveform of my audio file, and i am using AvAudioPlayer to play the audio. how can i set progress of the waveform when the audio is playing? guard let url = Bundle.main.url(forResource: "OriginalRecording", withExtension: "m4a") else { return } middleWaveformView.configuration = Waveform.Configuration( backgroundColor: .lightGray.withAlphaComponent(0.1), style: .striped(.init(color: UIColor.red, width: 2, spacing: 1)), verticalScalingFactor: 0.5 ) middleWaveformView.waveformAudioURL = url — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>