DE
games/rob-revisited / src / Revisited / Audio / Mixer.php · commit f9a1307
<?phpnamespace App\Revisited\Audio;/** * Where the Soundscape's sounds go. EngineMixer plays them (SoundManager for flat sounds and music, Audio3d for the * positional ones); MemoryMixer only remembers them (tests, the demo's list). Names are file names without extension * (assets/revisited/sfx/<name>.wav, assets/revisited/music/<name>.ogg). */interface Mixer{    /** A flat one-shot (footsteps, body, interface): heard the same wherever Rob looks. */    public function play(string $name): void;    /** A sound placed in the world ([x, y, z] metres). @return int voice id (0: not playing) */    public function playAt(string $name, array $pos, float $gain = 1.0, float $pitch = 1.0, bool $loop = false): int;    /** Moves a voice (null: stays) and sets its gain. */    public function update(int $voice, ?array $pos, float $gain): void;    public function stop(int $voice): void;    public function playing(int $voice): bool;    /** Rob's ears: position and forward direction (up = +y). */    public function listener(array $pos, array $forward): void;    /** The music loop to play (cross-faded), null: none. */    public function music(?string $name): void;    /** Each frame (fades). */    public function tick(float $dt): void;    public function stopAll(): void;}