Access volume control from Kiosk Mode

Posted about 1 year ago by Katharina.linden

Post a topic
Un Solved
K
Katharina.linden

Hi everyone,

is there a way to allow users to adjust the robots volume, while the robot is in Kiosk Mode? Possibly by using a voice command? 


Thanks in advance - Any help is appreciated! 

  


0 Votes


3 Comments

Sorted by
K

Katharina.linden posted about 1 year ago

This question is still not resolved - is there any way to adjust the volume while the robot is in Kiosk mode? TIA! 

0 Votes

K

Katharina.linden posted about 1 year ago

Hi Lukas, 

thanks for your reply! This seems to be the method I've been using so far. I used the .adjustStreamVolume with the AudioManager and 

type STREAM_MUSIC and connected it with a Qi bookmark, so users can adjust the volume by voice command. 


This works fine, as long as the robot is NOT in Kiosk Mode. As soon as I switch to Kiosk Mode this feature does no longer work. I assumed this is due to calling the volume from the settings? Is there any way around this? For my application, I do need the robot in Kiosk Mode to prevent users from changing basic settings by mistake or even deleting apps - but at the same time it is vital, that users can adjust the volume to their needs.  


Looking forward to your reply - and thank you in advance!

0 Votes

Lukas Brandt

Lukas Brandt posted about 1 year ago

Hello Katharina,

the volume of Pepper is controlled via Android with AudioManager and the StreamType STREAM_MUSIC.

You can control this as follows to set the volume to 70%:

AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
int currentVolume = audio.getStreamVolume(AudioManager.STREAM_MUSIC);
int maxVolume = audio.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
float percent = 0.7f;
int seventyVolume = (int) (maxVolume*percent);
audio.setStreamVolume(AudioManager.STREAM_MUSIC, seventyVolume, 0);



0 Votes

Login or Sign up to post a comment