pite-script 0.3.0

Embedded Python 3.12 scripting bridge (PyO3) and game API for Pite.
Documentation
// SPDX-License-Identifier: MIT OR Apache-2.0
use pyo3::exceptions::PyRuntimeError;
use pyo3::prelude::*;

#[pyfunction]
#[pyo3(signature = (path, volume = 1.0))]
pub fn play(path: &str, volume: f32) -> PyResult<u64> {
    pite_audio::play_file(path, volume).map_err(|e| PyRuntimeError::new_err(e.to_string()))
}

#[pyfunction]
pub fn stop(id: u64) {
    pite_audio::stop_voice(id);
}

#[pyfunction]
pub fn set_volume(id: u64, volume: f32) {
    pite_audio::set_voice_volume(id, volume);
}

#[pyfunction]
pub fn is_playing(id: u64) -> bool {
    pite_audio::voice_playing(id)
}