Sound System

OSL provides a comprehensive sound system for loading, playing, and manipulating audio in your applications.

Note: Sound handling requires OriginOS version 4.6.4 or later.

Basic Commands

Loading Sounds

Load a sound into RAM from a URL or data URI:

sound "url" "load" "name"

Playback Control

// Play from beginning
sound "url"/"name" "play"

// Pause playback
sound "url"/"name" "pause"

// Resume playback
sound "url"/"name" "unpause"

// Start at specific time
sound "url"/"name" "start" time

// Remove sound from memory
sound "url"/"name" "clear"

Sound Properties

Sound Information Methods

Multiple Sound Support

You can pass multiple sounds in an array to apply commands to multiple sounds simultaneously:

Example Usage

Basic Sound Player

Advanced Sound Control

Sound Progress Tracker

Important Notes

  • Always check if sounds are loaded before playing

  • Sound URLs can be external or data URIs

  • Volume values range from 0 to 1

  • Default playback speed is 1

  • Multiple sounds can be controlled simultaneously using arrays

  • Sound names must be unique when loading

  • Memory management is important - clear unused sounds

  • Sound availability depends on browser and system support

Last updated

Was this helpful?