Access volume control from Kiosk Mode

Publié sur un an il y a par  Katharina.linden

Publier un sujet
Non résolus
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 Commentaires

Triés par
K

Katharina.linden publiés sur un an il y a

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 publiés sur un an il y a

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 publiés sur un an il y a

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

Connexion ou S'inscrire pour poster un commentaire