dmrschmidt / DSWaveformImage

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

Generate the wave from URL. #39

Closed sanketk2020 closed 2 years ago

sanketk2020 commented 2 years ago

Hello,

I tried by downloading the audio file and saving it locally and then assign the URL to WaveformView but I get no results.

I get this error : ERROR loading asset / audio track

Is there any other way to generate the wave from the URL?

Thanks

dmrschmidt commented 2 years ago

Does the file play normally in an AVPlayer? That message typically comes up when the media format is not supported for instance.

Is the URL for the file you’re trying to use publicly available? If so, could you paste it here? I could try and have a look myself then. On 17. Aug 2022, 12:33 +0200, sanketk2020 @.***>, wrote:

Hello, I tried by downloading the audio file and saving it locally and then assign the URL to WaveformView but I get no results. I get this error : ERROR loading asset / audio track Is there any other way to generate the wave from the URL? Thanks — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

dmrschmidt commented 2 years ago

Also, did you have a look at this: scaffolded example for downloading a remote URL from issue #22 ?

dmrschmidt commented 2 years ago

Closed due to inactivity. Feel free to re-open if this is still an issue.

sanketk2020 commented 2 years ago

Yes, the file plays normally in an AVPlayer but I had an issue with accessing the URL; before I access the URL like this

URL(string: "XYZ")

but then I realize and change the way of accessing the URL like this

URL(fileURLWithPath: audioPath)

and this way works like charm.

Anyways thanks for the reply.

dmrschmidt commented 2 years ago

I'm glad to hear it works now :)