cb6d9e61d1
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
33 lines
871 B
C++
33 lines
871 B
C++
// audio_play — reproducir sonidos one-shot y streaming sobre fn::audio::Engine.
|
|
// Issue 0072b — runtime gamedev nucleo.
|
|
#pragma once
|
|
|
|
#include "audio_engine.h"
|
|
|
|
namespace fn::audio {
|
|
|
|
struct Sound {
|
|
void* impl; // ma_sound* opaco
|
|
bool ok;
|
|
};
|
|
|
|
// Carga y prepara un sonido (decodifica streaming desde disco). Sound.ok=false si falla.
|
|
Sound sound_load(Engine& e, const char* path);
|
|
|
|
// Arranca/reanuda reproduccion.
|
|
void sound_play(Sound& s);
|
|
|
|
// Detiene reproduccion (no libera).
|
|
void sound_stop(Sound& s);
|
|
|
|
// Volumen 0..1 del sonido (independiente del master).
|
|
void sound_set_volume(Sound& s, float v);
|
|
|
|
// Libera recursos del sonido.
|
|
void sound_destroy(Sound& s);
|
|
|
|
// Fire-and-forget: reproduce path una vez sin handle. No-op si engine no esta listo.
|
|
void play_sound_oneshot(Engine& e, const char* path, float volume = 1.0f);
|
|
|
|
} // namespace fn::audio
|