sound

Cross-platform sound mixer library

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Tags

Installation

nimble install sound
choosenim install sound
git clone https://github.com/yglukhov/sound.git

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
sound - - - - - - -

Source

Repository https://github.com/yglukhov/sound.git
Homepage https://github.com/yglukhov/sound
Registry Source nimble_official

README

sound nimble

Cross-platform sound mixer library

The library is using different "backends" depending on target platform: - Linux, MacOS, iOS: OpenAL. Supported formats: ogg+vorbis - Windows: XAudio2. Supported formats: ogg+vorbis - Android: SLES. Supported formats: ogg+vorbis - JavaScript, Asm.js: WebAudio. Supported formats: mp3 (and ogg+vorbis on some browsers)

Usage:

import sound.sound

when defined(android):
    var activity: jobject # You should get the reference to activity from somewhere.
    activity = androidGetActivity() # E.g. If you're using sdl.
    initSoundEngineWithActivity(activity)

var snd: Sound
when defined(android):
    # Supported URL schemes: android_asset, file
    snd = newSoundWithURL("android_asset://testfile.ogg") # The path is relative to assets folder
elif defined(js):
    snd = newSoundWithURL("testfile.ogg") # The url may be relative or absolute. The sound is loaded asynchronously.
else:
    # Supported URL schemes: file.
    snd = newSoundWithURL("file://" & getAppDir() & "/testfile.ogg")

snd.play()