emilib
Public Types | Public Member Functions | List of all members
al::SoundMngr Class Reference

You should have only one of these. More...

#include <al_lib.hpp>

Public Types

enum  DistanceModel { NONE, INVERSE_DISTANCE, INVERSE_DISTANCE_CLAMPED }
 

Public Member Functions

 SoundMngr (const std::string &sfx_dir)
 Look for sounds relative to sfx_dir.
 
void prefetch (const std::string &sound_name)
 sound_name == "subdir/foo.wav"
 
void prefetch_all (const std::string &sub_folder="")
 Recursively prefetch all textures in sfx_dir/sub_folder.
 
Source_SP play (const std::string &sound_name)
 
bool is_working () const
 
Listenerlistener ()
 
void set_doppler_vel (float vel)
 set speed of sound. 344 by default (speed of sound in air in meters/second)
 
float doppler_vel ()
 get speed of sound. 344 by default (speed of sound in air in meters/second)
 
void set_doppler_factor (float factor)
 default is 1, used to (de)exaggerate the effect of the Doppler effect
 
float doppler_factor ()
 default is 1, used to (de)exaggerate the effect of the Doppler effect
 
void set_distance_model (DistanceModel model)
 default is INVERSE_DISTANCE
 
DistanceModel distance_model ()
 default is INVERSE_DISTANCE
 
const char * vendor ()
 
const char * version ()
 
const char * renderer ()
 
const char * extensions ()
 
void print_memory_usage () const
 

Detailed Description

You should have only one of these.

Member Function Documentation

◆ play()

Source_SP al::SoundMngr::play ( const std::string &  sound_name)

Fire and forget - or keep the returned source and modify it. Returns nullptr on fail


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