Reputation: 11753
I have an issue on an iPhone app. I am looking at SystemVolumeDidChangeNotification and the related documentation and also browsing the net. But I can't find a simple way to get the current value of the SystemVolume. I cannot believe this information is impossible to get simply, but for some reason I have not been successful.
I also noticed the music application on iPod touch, does exactly what I would like to have, so it must be easy.
Anyone knows the answer?
Thank you for any relevant information.
Upvotes: 0
Views: 228
Reputation: 430
Here is the code for getting the current volume, the result output will be from 0.0 to 1.0.
Float32 volume;
UInt32 dataSize = sizeof(Float32);
Float32 currentVolume= AudioSessionGetProperty (
'chov',
&dataSize,
&volume
);
Upvotes: 1