Access API: Audio Output

Added in version 9.0.7

This JavaScript API allows you to check which audio output is currently in use.

Functions

Callbacks

Requirements

  • Access JavaScript API
    • 'By Import' - recommended, works both online & offline, requires inclusion of kiosk_functions.js prior to any of the following calls.
    • 'By Injection' - only works offline, may not be available 'onload' event.

Sample Code

This sample code relies on the JavaScript APIs built into Kiosk Pro and will not run successfully in other browsers or within our in-app help interface.  
To run sample code, set the app's homepage to http://www.kioskproapp.com/audio-output

Download Sample Code


kp_AudioSessionAPI_getCurrentAudioOutputPortType

This function determines which audio output is currently being used.

Format
kp_AudioSessionAPI_getCurrentAudioOutputPortType(callback);
		
Parameters callback = callback name as string
Callback format
callback(outputPortTypeString);
		
Callback return values

outputPortTypeString = a string which determines the output type. Possible values are:

  • LineOut = Line level output on a dock connector.
  • Headphones = Headphone or headset output.
  • BluetoothA2DPOutput = Output on a Bluetooth A2DP device.
  • Receiver = The speaker you hold to your ear when on a phone call.
  • Speaker = Built-in speaker on an iOS device.
  • HDMIOutput = Output via High-Definition Multimedia Interface.
  • AirPlay = Output on a remote Air Play device.
  • BluetoothLE = Output on a Bluetooth Low Energy device.
  • BluetoothHFP = Bluetooth Hands-Free Profile device.
  • USBAudio = a Universal Serial Bus device.
  • CarAudio = Car Audio.


kp_AudioSessionAPI_audioOutputPortTypeDidChange

This callback is triggered when the audio output has changed. For example, when headphones are plugged into the device.

Format
kp_AudioSessionAPI_audioOutputPortTypeDidChange(outputPortTypeString);
		
Return values

outputPortTypeString = a string which determines the output type. Possible values are:

  • LineOut = Line level output on a dock connector.
  • Headphones = Headphone or headset output.
  • BluetoothA2DPOutput = Output on a Bluetooth A2DP device.
  • Receiver = The speaker you hold to your ear when on a phone call.
  • Speaker = Built-in speaker on an iOS device.
  • HDMIOutput = Output via High-Definition Multimedia Interface.
  • AirPlay = Output on a remote Air Play device.
  • BluetoothLE = Output on a Bluetooth Low Energy device.
  • BluetoothHFP = Bluetooth Hands-Free Profile device.
  • USBAudio = a Universal Serial Bus device.
  • CarAudio = Car Audio.

Still stuck? How can we help? How can we help?