1

I have some MP3 files in my .xcassets folder. I can play them directly using AVKit's AVAudioPlayer(data: NSDataAsset(name: "foo")!.data).play(). But, I want to extract the Metadata of the song using AVPlayerItem. But AVPlayerItem's Initializer wants an URL as parameter.

How to extract the URL of an NSDataAsset ? I am using UIKit Framework btw.

Kris2k
  • 275
  • 2
  • 12

1 Answers1

1

I have some problem when wav or mp3 storage in assets.xcassets. I fixed this issue by put all audio from assets.xcassets into project folder. But I don't know what happen in it when use assets.xcassets.

  • Yes I too had the same problem. Since xcassets problem could not be solved. I put those mp3 files in project folder itself. Only then, I could get the URL of those mp3 files. – Kris2k Mar 14 '23 at 09:09
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 19 '23 at 19:59