Skip to main content

Aila_EnableSpeaker

Enable audio playback through speaker and disable modem communications.

Signature

void Aila_EnableSpeaker(void);

Description

Enables audio output to be played through the Apple device's built-in speaker. Since the Aila SDK communicates over the audio jack (on Lightning-based iPads), communication between Aila Hardware and the SDK will not function as long as the speaker is enabled.

This will cause the kiosk illumination to stop after 10 seconds. This can be overridden to support scenarios where audio needs to be played (e.g., voiceovers for ADA or videos with audio). See Aila_OverrideLightTimeout() for details.

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.

System Sound Services

The System Sound Services API (AudioServicesCreateSystemSoundID, AudioServicesPlaySystemSound, etc.) does not respect audio route overrides. Sound played using System Sound Services will not play over the speaker. APIs that do respect audio route overrides (e.g., AVAudioPlayer) should be used instead.

Usage

// Enable speaker for audio playback
Aila_EnableSpeaker();

// Play audio using AVAudioPlayer
NSURL *audioURL = [[NSBundle mainBundle] URLForResource:@"audio" withExtension:@"mp3"];
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:audioURL error:nil];
[player play];

// When done, disable speaker to restore communications
Aila_DisableSpeaker();

See Also