Switching Audio output from Remote

Hi Guys,

anyone can give me some idea how I can configure a button on the remote to toggle the audio setting between HDMI and USB Audio (Alsa)?
Currently I am doing it from my notebook via JSON but would be great just to have a button on the remote to toggle between the two.

Cheers

Fred

To HDMI
curl -H “Content-type: application/json” -X POST -d ‘{“jsonrpc”:“2.0”,“method”:“Settings.SetSettingValue”, “params”:{“setting”:“audiooutput.audiodevice”,“value”:“PI:HDMI”},“id”:1}’ http://user:password@osmc:8080/jsonrpc

To USB
curl -H “Content-type: application/json” -X POST -d ‘{“jsonrpc”:“2.0”,“method”:“Settings.SetSettingValue”, “params”:{“setting”:“audiooutput.audiodevice”,“value”:“ALSA:@:CARD=Device,DEV=0”},“id”:1}’ http://user:password@osmc:8080/jsonrpc