Hi everyone,
Below is the trick to check the iPhone/iPad/iPod Touch (iOS Device) volume level. Please take a look..
Float32 volume;
UInt32 dataSize = sizeof(Float32);
AudioSessionGetProperty (
kAudioSessionProperty_CurrentHardwareOutputVolume,
&dataSize,
&volume
);
NSLog(@"Volume Level : %f",volume);
if (volume <= 0.25)
{
NSLog(@"Volume is below %d \%",(volume*100));
}
Thanks,
Nilesh M. Prajapati
Below is the trick to check the iPhone/iPad/iPod Touch (iOS Device) volume level. Please take a look..
#import <AudioToolbox/AudioToolbox.h>
UInt32 dataSize = sizeof(Float32);
AudioSessionGetProperty (
kAudioSessionProperty_CurrentHardwareOutputVolume,
&dataSize,
&volume
);
NSLog(@"Volume Level : %f",volume);
if (volume <= 0.25)
{
NSLog(@"Volume is below %d \%",(volume*100));
}
Thanks,
Nilesh M. Prajapati
Its not working,Always show 0 value. :(
ReplyDelete