dimitris-c / AudioStreaming

An AudioPlayer/Streaming library for iOS written in Swift using AVAudioEngine.
MIT License
266 stars 56 forks source link

Volume setting #47

Closed haecksenwerk closed 1 year ago

haecksenwerk commented 1 year ago

Hey!

First of all, thank you for this neat library. It drives my SwiftUI radio app. The audio streaming and ICY metadata parsing works perfectly well.

There is just one thing: Is it possible to have the player.volume setting of the AudioStreaming engine linked to the iOS volume?

dimitris-c commented 1 year ago

I believe you can observe the system's volume and adjust the AudioStreaming engine volume - read more here https://developer.apple.com/documentation/avfaudio/avaudiosession/1616533-outputvolume

You can observe changes to the value of this property by using Key-value observing

haecksenwerk commented 1 year ago

Thanks for pointing me there.