Support Forum       G3D Web Page     
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
G3D::AudioChannel Class Reference

A playing Sound. More...

Public Member Functions

bool done () const
 Return true if the sound has finished playing and the channel is no longer needed. More...
 
bool paused () const
 
void set3DAttributes (const Point3 &wsPosition, const Vector3 &wsVelocity)
 In world space. More...
 
void setFrequency (float hz)
 Playback frequency in Hz. More...
 
void setPan (float p)
 
void setPaused (bool paused)
 
void setVolume (float v)
 
void stop ()
 Stop the sound currently playing on this channel. More...
 

Protected Member Functions

 AudioChannel (FMOD::Channel *f)
 
void cleanup ()
 Delete resources. More...
 

Protected Attributes

FMOD::Channel * m_fmodChannel
 

Friends

class AudioDevice
 
class Sound
 

Detailed Description

A playing Sound.

See also
G3D::Sound::play, G3D::SoundEntity, G3D::Entity::playSound

Constructor & Destructor Documentation

◆ AudioChannel()

G3D::AudioChannel::AudioChannel ( FMOD::Channel *  f)
inlineprotected

Member Function Documentation

◆ cleanup()

void G3D::AudioChannel::cleanup ( )
protected

Delete resources.

◆ done()

bool G3D::AudioChannel::done ( ) const

Return true if the sound has finished playing and the channel is no longer needed.

◆ paused()

bool G3D::AudioChannel::paused ( ) const

◆ set3DAttributes()

void G3D::AudioChannel::set3DAttributes ( const Point3 wsPosition,
const Vector3 wsVelocity 
)

In world space.

The velocity is used for dopler; the sounds will not automatically move on their own but must be set each main loop iteration.

◆ setFrequency()

void G3D::AudioChannel::setFrequency ( float  hz)

Playback frequency in Hz.

◆ setPan()

void G3D::AudioChannel::setPan ( float  p)
Parameters
p-1.0 = left, 0.0 = center, 1.0 = right

◆ setPaused()

void G3D::AudioChannel::setPaused ( bool  paused)

◆ setVolume()

void G3D::AudioChannel::setVolume ( float  v)
Parameters
von [0, 1]

◆ stop()

void G3D::AudioChannel::stop ( )

Stop the sound currently playing on this channel.

Friends And Related Function Documentation

◆ AudioDevice

friend class AudioDevice
friend

◆ Sound

friend class Sound
friend

Member Data Documentation

◆ m_fmodChannel

FMOD::Channel* G3D::AudioChannel::m_fmodChannel
protected

documentation generated on Wed Nov 24 2021 08:01:53 using doxygen 1.8.15