LogoLogo
ALO.ai
Developer Documentation
Developer Documentation
  • Developer Documentation
  • Developer Account
    • API Key
  • SDKs
    • Authentication
    • Chat
      • Configuration
      • Send Messages
        • Upload Files
      • Message History
      • Message Actions
      • Message Counts
      • Translation
      • Typing Indicators
      • API Reference
        • Event
        • Message
    • Presence
      • Configuration
      • Basic Usage
      • Methods
    • Audio
      • Prerequisites
      • Instantiating Audio Service
      • Connect to a Channel
      • Disconnecting Audio Service
      • Push To Talk (PTT)
      • Full Duplex
      • Mute and Unmute Audio
      • Input/Output Device Selection
        • Microphone Selection
        • Speaker Selection
      • Channel Participants
      • Text To Speech Audio (TTS)
      • Automatic Reconnects
      • Handling Events
      • Classes
        • AloAudio
        • AudioUser
        • AudioChannel
        • Participant
    • Video
      • Prerequisites
      • Instantiating Video Service
      • Connect to a Channel
      • Disconnecting Video Service
      • Input Device Selection
        • Microphone Selection
        • Camera Selection
      • Publishing Streams
      • Modifying Published Streams
      • Channel Participants
      • Rendering Streams
        • Local Stream
        • Remote Streams
      • Muting/Unmuting Remote Streams
      • Recording Video (coming soon)
      • Automatic Reconnects
      • Handling Events
      • Classes
        • AloVideo
        • Participant
        • VideoChannel
        • VideoUser
  • ALO APPS
    • Overview
    • Creating Apps
    • Webhooks
      • Verifying Requests from ALO
    • Custom Action Forms
    • Using the ALO Platform API
  • ALO Platform API
    • Overview
    • Authentication
    • API
      • Actions and Periods
      • Channels
      • Channel Messages
      • Channel Users
      • Direct Message Channels
      • Direct Message Channel Chat Messages
      • Direct Message Channel Users
      • Groups
      • Periods
      • Types
      • Users
      • Video Management System
  • Misc
    • Supported Language Codes
Powered by GitBook
LogoLogo

ALO.ai

  • ALO.ai

© Copyright 2025 ALO.ai, Inc. • All Rights Reserved

On this page
  • Getting Available Devices
  • Example Device List Retrieval
  • Input Device Related Events
  1. SDKs
  2. Audio

Input/Output Device Selection

PreviousMute and Unmute AudioNextMicrophone Selection

Last updated 4 years ago

Getting Available Devices

Before connecting to an audio channel you have the option of selecting which audio input () and output () device to use. If you do not specify an input device the operating system's default device will be used.

In order to get the current list of available audio devices you can use the method.

Example Device List Retrieval

let devices = await aloAudio.getMediaList();
const listElement = document.querySelector('select#availableMicrophones');
listElement.innerText = null;

Object.values(devices[AloAudio.MEDIA_DEVICE_LIST_AUDIO_INPUT]).forEach(device => {
  const inputOption = document.createElement('option');
  inputOption.value = device.id;
  inputOption.label = device.label;
  inputOption.innerText = device.label;
  listElement.add(inputOption);
});

You should also add a listener for the onDeviceListUpdate event. If input devices change you can update your input device selection.

Input Device Related Events

Event

Description

onDeviceListUpdate

This event will let you know the list of available input devices has changed.

Example onDeviceListUpdate event payload:

{
  detail : {
    type: "audioinput",
    devices : {
      80c24043a7acb547b1eda7f0de20ea9917e6dea90091dab7a5a5258f74e91714: {
        id: "80c24043a7acb547b1eda7f0de20ea9917e6dea90091dab7a5a5258f74e91714",
        label: ""Microphone (HD Webcam C615) (046d:082c)"",
        type: "audioinput"
      },
      752999ac8b718aa41f3d2a9755dfabf2b8f80d613701a36b487939b38ab6095d: {
        id: "752999ac8b718aa41f3d2a9755dfabf2b8f80d613701a36b487939b38ab6095d",
        label: "Microphone Array (Realtek(R) Audio)",
        type: "audioinput"
      }
    }
  }
}
microphone
speaker
getMediaList()