![]() |
Gorgon Game Engine
|
Contains audio subsystem. For audio primitives look into multimedia namespace. More...
Namespaces | |
internal | |
Classes | |
class | BasicController |
Basic controller, allows non-positional playback of data buffer. More... | |
class | Controller |
This is the base class for all controllers. More... | |
class | Device |
Represents an audio device. More... | |
class | Environment |
The environment which the audio system works on. More... | |
class | Listener |
Listener class sets the properties for the audio listener. More... | |
class | PositionalController |
Positional controller allows sounds to be played at a specific location. More... | |
Enumerations | |
enum | Channel { Unknown, Mono, FrontLeft, FrontRight, BackLeft, BackRight, Center, LowFreq } |
Names for channels. More... | |
enum | ControllerType { Basic, Positional } |
Identifies controller types. More... | |
enum | Format { PCM8, PCM16, Float } |
Sample format. More... | |
Functions | |
void | AudioLoop () |
DefineEnumStrings (Channel, { Channel::Unknown, "Unknown" }, { Channel::Mono, "Mono" }, { Channel::FrontLeft, "Front left" }, { Channel::FrontRight, "Front right" }, { Channel::BackLeft, "Back left" }, { Channel::BackRight, "Back right" }, { Channel::Center, "Center" }, { Channel::LowFreq, "Bass" },) | |
float | GetVolume () |
Returns the master volume. More... | |
float | GetVolume (Channel channel) |
Returns the volume of a channel. More... | |
void | Initialize () |
Starts audio subsystem with the default device. More... | |
bool | IsAvailable () |
Whether the audio is available. More... | |
Utils::Logger | Log ("Audio") |
void | SetVolume (Channel channel, float volume) |
Changes the volume of a channel. More... | |
void | SetVolume (float volume) |
Changes the master volume. More... | |
std::vector< Channel > | StandardChannels (int channelcount) |
Variables | |
Device | Current |
Utils::Logger | Log |
Contains audio subsystem. For audio primitives look into multimedia namespace.
|
strong |
|
strong |
|
strong |
void Gorgon::Audio::AudioLoop | ( | ) |
References Basic, Gorgon::Audio::internal::BufferDuration, Gorgon::Audio::internal::BufferSize, Center, Gorgon::Audio::internal::ControllerMtx, Gorgon::Audio::internal::Controllers, Current, Environment::Current, Gorgon::Audio::internal::exitfn(), Gorgon::exiting, Wave::FindChannel(), Device::FindChannel(), Gorgon::String::From(), Device::GetChannelCount(), BasicController::GetDuration(), Device::GetSampleRate(), Device::IsHeadphones(), Log, Gorgon::Audio::internal::mastervolume, basic_Point3D< T_ >::Normalize(), Unknown, Gorgon::Audio::internal::volume, and BasicController::wavedata.
Gorgon::Audio::DefineEnumStrings | ( | Channel | , |
{ Channel::Unknown, "Unknown" } | , | ||
{ Channel::Mono, "Mono" } | , | ||
{ Channel::FrontLeft, "Front left" } | , | ||
{ Channel::FrontRight, "Front right" } | , | ||
{ Channel::BackLeft, "Back left" } | , | ||
{ Channel::BackRight, "Back right" } | , | ||
{ Channel::Center, "Center" } | , | ||
{ Channel::LowFreq, "Bass" } | |||
) |
References Unknown.
float GetVolume | ( | ) |
Returns the master volume.
References Gorgon::Audio::internal::mastervolume.
float GetVolume | ( | Channel | channel | ) |
Returns the volume of a channel.
If the channel does not exists, this function will return 0.
References Current, Device::GetChannel(), Device::GetChannelCount(), and Gorgon::Audio::internal::volume.
void Gorgon::Audio::Initialize | ( | ) |
Starts audio subsystem with the default device.
Initializes the filesystem module.
Gorgon system requires every module to have initialization function even if they are not used. Currently used for following tasks:
Set startup directory
There is a mechanism to ensure initialization is performed once.
bool Gorgon::Audio::IsAvailable | ( | ) |
Whether the audio is available.
Utils::Logger Gorgon::Audio::Log | ( | "Audio" | ) |
void SetVolume | ( | Channel | channel, |
float | volume | ||
) |
Changes the volume of a channel.
If the channel is not found, nothing is done except if the channel is mono. In that case all channel's volume is changed.
References Current, Device::GetChannel(), Device::GetChannelCount(), and Gorgon::Audio::internal::volume.
void SetVolume | ( | float | volume | ) |
Changes the master volume.
References Gorgon::Audio::internal::mastervolume, and Gorgon::Audio::internal::volume.
std::vector<Channel> Gorgon::Audio::StandardChannels | ( | int | channelcount | ) |
Device Current |
Utils::Logger Log("Audio") |