Audio in Spectacles
When developing experiences for Spectacles, you must consider additional aspects of the Audio Component beyond the standard platform features.
Mix To Snap
The Mix to Snap feature, which allows recording sound directly into Snap, is automatically applied to all Audio Components by default in Spectacles. The flag for this in the Audio Component will be ignored.
Playback Modes
The Playback Mode property of the AudioComponent can only be set through a script. Spectacles default all Playback Modes to Low Power.
Low Power
Reduces power usage for the Spectacles device. but introduces latency in audio playback. Suitable for ambient sounds or background music where slight delays are acceptable.
@component
export class NewScript extends BaseScriptComponent {
@input
audio: AudioComponent;
onAwake() {
this.audio.playbackMode = Audio.PlaybackMode.LowPower;
}
}
Low Latency
Minimizes audio playback latency but increases power usage for the Spectacles device. Recommended for audio requiring immediate auditory reaction, such as button press feedback.
@component
export class NewScript extends BaseScriptComponent {
@input
audio: AudioComponent;
onAwake() {
this.audio.playbackMode = Audio.PlaybackMode.LowLatency;
}
}
Audio Input Profiles
Spectacles automatically add audio profiles based on the features applied to your Lens. By default, no Audio Input Profiles are applied.
Audio Input Profiles Include:
-
Bystander Speech Rejection: Ignores speech not coming from the Spectacles wearer, preventing unintended speech transcription from nearby conversations when the wearer is not talking.
-
Echo Cancellation: Eliminates the feedback loop from sounds generated by the speakers that would otherwise be picked up by the microphone.
Analysis Profile
Applied when Microphone Audio is used in your Lens project.
When the Analysis Profile is active the following are used:
- Echo Cancellation
Voice Profile
Applied when VoiceMLModule is used in your Lens project.
When the Voice Profile is active, the following are used:
- Bystander Speech Rejection
- Echo Cancellation
If both Microphone Audio and VoiceMLModule are used simultaneously, the Voice Profile will take precedence over the Analysis Profile.