Choose a Media API
AIUI provides audio playback, short sound effects, audio processing, video playback, media capture, and media library access. Start with the task you want to complete, then open the corresponding page for examples and the full API.
Choose by Task
| If you want to | Choose |
|---|---|
| Play music, a local audio file, or audio data as it arrives | Audio Playback |
| Play short local sounds such as button clicks and prompts repeatedly | Short Sound Effects (Sound) |
| Generate sound, play PCM data, or analyse microphone volume, waveforms, and frequency data | Audio Processing (Web Audio) |
| Play video in a page and control its playback state | Video Playback |
| Use a microphone or camera to take photos or record audio and video | Media Capture |
| Browse, read, or save images and audio in the system media library | Media Library |
| Select a microphone mode or record system playback audio | Select a Recording Source |
Continue Reading
- Audio Playback: Use
AudioPlayerto play local audio or audio data as it arrives. - Short Sound Effects (Sound): Use the lightweight
SoundAPI for button clicks and prompt sounds. - Audio Processing (Web Audio): Generate sound, play PCM data, adjust sound, or analyse microphone volume, waveforms, and frequency data.
- Video Playback: See the
<video>component and itsVideoContextplayback controls. - Media Capture: Use
navigator.mediaDevices,ImageCapture,MediaRecorder, and wx-style APIs to take photos or record audio and video. - Media Library: Browse, read, and save images and audio in the system media library.