nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::Ambience Class Reference

#include <ambience.h>

Public Member Functions

 Ambience (uint32_t seed)
void UseRain (Samples left, Samples right)
void UseFire (Samples left, Samples right)
void UseGust (const Samples &left, const Samples &right)
void Fill (std::span< float > left, std::span< float > right, const Hearing &hearing)
void Thunder (float metres, float pan)

Detailed Description

The weather and the time of day, as sound: a few loops made as the game starts, that play all the time, each as loud as it should be now, and birds, owls, drips and thunder now and then, made as they come.

Definition at line 46 of file ambience.h.

Constructor & Destructor Documentation

◆ Ambience()

nanommo::Ambience::Ambience ( uint32_t seed)
explicit

Definition at line 376 of file ambience.cc.

Member Function Documentation

◆ Fill()

void nanommo::Ambience::Fill ( std::span< float > left,
std::span< float > right,
const Hearing & hearing )

Adds the next of the sound into the two channels, as many samples as they have, while each loop glides to how loud the hearing says.

Definition at line 456 of file ambience.cc.

◆ Thunder()

void nanommo::Ambience::Thunder ( float metres,
float pan )

The thunder of a bolt this many metres away, from that side, from -1 for the left to 1 for the right. It comes as long after the flash as sound takes to come that far.

Definition at line 450 of file ambience.cc.

◆ UseFire()

void nanommo::Ambience::UseFire ( Samples left,
Samples right )

Fire recorded crackling, in place of the fire made from numbers, the same way.

Definition at line 412 of file ambience.cc.

◆ UseGust()

void nanommo::Ambience::UseGust ( const Samples & left,
const Samples & right )

A gust of wind recorded, which blows now and then over the wind made from numbers, more often the windier it is.

Definition at line 418 of file ambience.cc.

◆ UseRain()

void nanommo::Ambience::UseRain ( Samples left,
Samples right )

Rain recorded from the real thing, in place of the rain made from numbers, its two channels as long as each other. It loops, its end fading into its start, and plays as loud as the one it replaces.

Definition at line 430 of file ambience.cc.


The documentation for this class was generated from the following files: