adamcichy / SwiftySound

SwiftySound is a simple library that lets you play sounds with a single line of code.
MIT License
1.25k stars 99 forks source link

instance play not works. #68

Open isayeter opened 7 months ago

isayeter commented 7 months ago

Hello,

This works:

Sound.play(url: realFile, numberOfLoops: numLoop)

but, this is not working:

let mySound = Sound(url: realFile)
mySound?.volume = Float(volume) //volume is absolutely 1.0, checked.
mySound?.play(numberOfLoops: numLoop)

Any suggestion? Thank you.

adamcichy commented 7 months ago

Hello,

Have you checked the example app? It works there

Thanks, Adam

isayeter commented 7 months ago

Yes I have. checked the demo, when I use

Sound.play(url: realFile, numberOfLoops: numLoop)

it works, but I need to adjust the volume, so I changed the code to:

let mySound = Sound(url: realFile)
mySound?.volume = Float(volume)
mySound?.play(numberOfLoops: numLoop)

it doesn't work, everything else is the same. (I'm not using a file in the Bundle, I'm trying to play an .mp3 file in the documents folder btw)