载入中...
搜索中...
未找到
eve::audio::Audio类 参考

OpenAL audio module: device management, master listener state, and Source factory. Script: audio <- eve.Audio(); 更多...

#include <Audio.h>

类 eve::audio::Audio 继承关系图:
eve::Module

Public 成员函数

 Module_REG (Audio)
 
 Audio ()
 Audio.
 
 ~Audio () override
 Audio.
 
Source * newSource (sound::SoundData *data)
 Creates a static (non-streaming) Source from decoded sound data.
 
Source * newSourceFromDecoder (sound::Decoder *decoder, std::string type)
 Creates a Source from a decoder; type must be "static" or "stream".
 
Source * newSourceFromData (Data *data, std::string type)
 Creates a Source from raw encoded data; type must be "static" or "stream".
 
Result< std::unique_ptr< PcmStream > > newPcmStream (int sampleRate, int channels)
 Allocate a bounded PCM stream without a Sound/decoder dependency.
 
void play (Source *s)
 Starts playback of a source (no-op when s is null).
 
void stop (Source *s)
 Stops playback of a source (no-op when s is null).
 
void stopAll ()
 Stops every live Source and permanently closes caller-fed PCM streams.
 
int getSourceCount ()
 Return the current number of caller- or handler-owned live sources.
 
void pause (Source *s)
 Pauses a source (no-op when s is null).
 
void setVolume (float v)
 Sets master volume (clamped to >= 0) applied to the OpenAL listener.
 
float getVolume () const
 Returns the volume.
 
void setPosition (float x, float y, float z)
 Sets the listener position in world units.
 
void setVelocity (float x, float y, float z)
 Sets the listener velocity (used by OpenAL doppler).
 
void setOrientation (float fx, float fy, float fz, float ux, float uy, float uz)
 Sets the listener forward and up orientation vectors.
 
void pump ()
 Advances streaming sources; call once per frame from the main thread.
 
void registerStream (Source *s)
 Internal: registers a streaming source with the decode worker.
 
void unregisterStream (Source *s)
 Internal: removes a source from worker tracking.
 
void unregisterSource (Source *s)
 Internal: removes a source from all module tracking.
 
void notifyWorker ()
 Internal: wakes the decode worker thread.
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 Module.
 
virtual std::string getName () const =0
 Returns the name.
 

详细描述

OpenAL audio module: device management, master listener state, and Source factory. Script: audio <- eve.Audio();

在文件 Audio.h 第 34 行定义.

构造及析构函数说明

◆ Audio()

eve::audio::Audio::Audio ( )

Audio.

在文件 Audio.cpp 第 30 行定义.

引用了 eve::audio::bindAudioEventSinkOwner(), context, device , 以及 value.

◆ ~Audio()

eve::audio::Audio::~Audio ( )
override

Audio.

在文件 Audio.cpp 第 51 行定义.

引用了 eve::audio::bindAudioEventSinkOwner() , 以及 state.

成员函数说明

◆ getSourceCount()

int eve::audio::Audio::getSourceCount ( )

Return the current number of caller- or handler-owned live sources.

在文件 Audio.cpp 第 183 行定义.

◆ getVolume()

float eve::audio::Audio::getVolume ( ) const

Returns the volume.

在文件 Audio.cpp 第 192 行定义.

◆ Module_REG()

eve::audio::Audio::Module_REG ( Audio  )

◆ newPcmStream()

Result< std::unique_ptr< PcmStream > > eve::audio::Audio::newPcmStream ( int  sampleRate,
int  channels 
)

Allocate a bounded PCM stream without a Sound/decoder dependency.

参数
sampleRateOutput frames per second, 8000..192000.
channelsOne (mono) or two (interleaved stereo).
返回
Unique caller ownership, or a format/backend diagnostic. @ownership Caller owns the stream; Audio keeps only a weak backend reference. @lifetime Audio destruction closes surviving streams; they then report Closed. @thread Owning/main thread only, including stream destruction. @reentrancy No callbacks. @cost Allocates an OpenAL source and eight buffers; reuse the returned stream across many submissions/effects.

在文件 Audio.cpp 第 119 行定义.

引用了 channels , 以及 result.

◆ newSource()

Source * eve::audio::Audio::newSource ( sound::SoundData *  data)

Creates a static (non-streaming) Source from decoded sound data.

参数
dataDecoded audio (must be non-null; the caller keeps ownership).

在文件 Audio.cpp 第 112 行定义.

引用了 s.

被这些函数引用 newSourceFromData() , 以及 newSourceFromDecoder().

◆ newSourceFromData()

Source * eve::audio::Audio::newSourceFromData ( Data *  data,
std::string  type 
)

Creates a Source from raw encoded data; type must be "static" or "stream".

在文件 Audio.cpp 第 147 行定义.

引用了 newSource(), s , 以及 type.

◆ newSourceFromDecoder()

Source * eve::audio::Audio::newSourceFromDecoder ( sound::Decoder *  decoder,
std::string  type 
)

Creates a Source from a decoder; type must be "static" or "stream".

在文件 Audio.cpp 第 126 行定义.

引用了 newSource(), s , 以及 type.

◆ notifyWorker()

void eve::audio::Audio::notifyWorker ( )

Internal: wakes the decode worker thread.

在文件 Audio.cpp 第 110 行定义.

被这些函数引用 eve::audio::Source::play(), eve::audio::Source::pump() , 以及 eve::audio::Source::seek().

◆ pause()

void eve::audio::Audio::pause ( Source *  s)

Pauses a source (no-op when s is null).

在文件 Audio.cpp 第 167 行定义.

引用了 s.

◆ play()

void eve::audio::Audio::play ( Source *  s)

Starts playback of a source (no-op when s is null).

在文件 Audio.cpp 第 161 行定义.

引用了 s.

◆ pump()

void eve::audio::Audio::pump ( )

Advances streaming sources; call once per frame from the main thread.

在文件 Audio.cpp 第 201 行定义.

引用了 EV_PROFILE_MODULE, s , 以及 state.

◆ registerStream()

void eve::audio::Audio::registerStream ( Source *  s)

Internal: registers a streaming source with the decode worker.

在文件 Audio.cpp 第 97 行定义.

引用了 s.

◆ setOrientation()

void eve::audio::Audio::setOrientation ( float  fx,
float  fy,
float  fz,
float  ux,
float  uy,
float  uz 
)

Sets the listener forward and up orientation vectors.

在文件 Audio.cpp 第 196 行定义.

◆ setPosition()

void eve::audio::Audio::setPosition ( float  x,
float  y,
float  z 
)

Sets the listener position in world units.

在文件 Audio.cpp 第 194 行定义.

引用了 x, y , 以及 z.

◆ setVelocity()

void eve::audio::Audio::setVelocity ( float  x,
float  y,
float  z 
)

Sets the listener velocity (used by OpenAL doppler).

在文件 Audio.cpp 第 195 行定义.

引用了 x, y , 以及 z.

◆ setVolume()

void eve::audio::Audio::setVolume ( float  v)

Sets master volume (clamped to >= 0) applied to the OpenAL listener.

在文件 Audio.cpp 第 188 行定义.

引用了 v.

◆ stop()

void eve::audio::Audio::stop ( Source *  s)

Stops playback of a source (no-op when s is null).

在文件 Audio.cpp 第 164 行定义.

引用了 s.

◆ stopAll()

void eve::audio::Audio::stopAll ( )

Stops every live Source and permanently closes caller-fed PCM streams.

在文件 Audio.cpp 第 170 行定义.

引用了 s , 以及 state.

◆ unregisterSource()

void eve::audio::Audio::unregisterSource ( Source *  s)

Internal: removes a source from all module tracking.

在文件 Audio.cpp 第 102 行定义.

引用了 s.

被这些函数引用 unregisterStream() , 以及 eve::audio::Source::~Source().

◆ unregisterStream()

void eve::audio::Audio::unregisterStream ( Source *  s)

Internal: removes a source from worker tracking.

在文件 Audio.cpp 第 108 行定义.

引用了 s , 以及 unregisterSource().


该类的文档由以下文件生成: