Skip to content

AudioFileWaveform using with changing URLs #89

Description

@mahal

Description

Consider following View (pseudo code):

var audioFiles: [AudioFile] // set somewhere on init

var body: some View {
     let audioFile = audioFiles[loadedFileIndex]
     Picker("Sound File", selection: $loadedFileIndex) {
          ForEach(audioFiles.indices, id: \.self) { index in
               Text("\(.audioFiles[index].name)")
          }
      }
     AudioFileWaveform(url: audioFile.url, color: .blue) 
}

This will not update AudioFileWaveform with the new file chosen.

Proposed Solution

See PR 90

Describe Alternatives You've Considered

.didSet on var url: URL of AudioFileWaveform, didn't work
the deprecated onChange() didn't know how to test / implement

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions