Aila_DisableSpeaker
Disable audio playback through speaker and re-enable modem communications.
Signature
- Objective-C
- Swift
void Aila_DisableSpeaker(void);
func Aila_DisableSpeaker()
Description
Disables audio output through the Apple device's built-in speaker and re-enables communications with the kiosk. This should be called after Aila_EnableSpeaker() when audio playback is complete.
This function may block for up to 1 second, depending on hardware and iOS version.
Lightning Devices Only
This feature only applies to Lightning-based iPads when connected to a kiosk over the audio jack.
Usage
- Objective-C
- Swift
// Enable speaker for audio
Aila_EnableSpeaker();
// Play audio...
[self.audioPlayer play];
// Wait for audio to finish, then restore communications
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC),
dispatch_get_main_queue(), ^{
Aila_DisableSpeaker();
});
// Enable speaker for audio
Aila_EnableSpeaker()
// Play audio...
audioPlayer.play()
// Wait for audio to finish, then restore communications
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
Aila_DisableSpeaker()
}
See Also
- Aila_EnableSpeaker - Enable speaker and disable communications
- Aila_OverrideLightTimeout - Keep lighting active during audio