Kashish Goel
Kashish Goel

Reputation: 94

Convert mp3 file into URL in swift

I have sound files (mp3 and m4a) that I imported into my xCode project that I need to convert into URLs.

Upvotes: 0

Views: 766

Answers (1)

Leo Dabus
Leo Dabus

Reputation: 236295

You can use URLForResource:

if let audioURL = Bundle.main.url(forResource: "audioName", withExtension: "mp3") {
    print(audioURL) 
}

Upvotes: 4

Related Questions