[package]
name = "game-audio"
license = "MIT OR Apache-2.0"
version = "0.5.1"
authors = ["p <p@p11c.xyz>"]
edition = "2024"
description = "Procedural game audio: generate tones, noise, and pattern-based music without audio files"
repository = "https://gitlab.com/porky11/game-audio"
readme = "README.md"

[dependencies]
rodio = { version = "0.22", default-features = false }
thiserror = "2.0"
hound = { version = "3.5", optional = true }
mp3lame-encoder = { version = "0.2.2", optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
rodio = { version = "0.22", default-features = false, features = [
    "playback",
    "flac",
    "mp3",
    "mp4",
    "vorbis",
    "wav",
    "dither",
] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
web-sys = { version = "0.3", features = [
    "AudioContext",
    "BaseAudioContext",
    "AudioBuffer",
    "AudioBufferSourceNode",
    "AudioScheduledSourceNode",
    "AudioNode",
    "AudioDestinationNode",
    "AudioParam",
    "GainNode",
] }

[features]
export = ["hound", "mp3lame-encoder"]

[[bin]]
name = "track-export"
required-features = ["export"]
