Ref/openal-Phpdoc专题
openal_buffer_create
Generate OpenAL buffer
说明
resource <span class="methodname">openal_buffer_create ( <span class="methodparam">void )
返回值
Returns an
Open AL(Buffer)
resource on success or false on failure.
参见
- openal_buffer_loadwav
- openal_buffer_data
openal_buffer_data
Load a buffer with data
说明
bool <span
class="methodname">openal_buffer_data ( <span
class="methodparam">resource $buffer
, int
$format , <span
class="type">string $data , <span
class="methodparam">int $freq )
参数
buffer
An
Open AL(Buffer)
resource (previously created by <span
class="function">openal_buffer_create).
format
Format of data, one of: AL_FORMAT_MONO8, AL_FORMAT_MONO16,
AL_FORMAT_STEREO8 和 AL_FORMAT_STEREO16
data
Block of binary audio data in the format and freq specified.
freq
Frequency of data given in Hz.
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_buffer_loadwav
- openal_stream
openal_buffer_destroy
Destroys an OpenAL buffer
说明
bool <span
class="methodname">openal_buffer_destroy ( <span
class="methodparam">resource $buffer
)
参数
buffer
An
Open AL(Buffer)
resource (previously created by <span
class="function">openal_buffer_create).
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_buffer_create
openal_buffer_get
Retrieve an OpenAL buffer property
说明
int<span
class="type">false <span
class="methodname">openal_buffer_get ( <span
class="methodparam">resource $buffer
, int
$property )
参数
buffer
An
Open AL(Buffer)
resource (previously created by <span
class="function">openal_buffer_create).
property
Specific property, one of: AL_FREQUENCY, AL_BITS,
AL_CHANNELS 和 AL_SIZE.
返回值
Returns an integer value appropriate to the property requested
或者在失败时返回 false.
参见
- openal_buffer_create
openal_buffer_loadwav
Load a .wav file into a buffer
说明
bool <span
class="methodname">openal_buffer_loadwav ( <span
class="methodparam">resource $buffer
, string
$wavfile )
参数
buffer
An
Open AL(Buffer)
resource (previously created by <span
class="function">openal_buffer_create).
wavfile
Path to .wav file on local file system.
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_buffer_data
- openal_stream
openal_context_create
Create an audio processing context
说明
resource <span
class="methodname">openal_context_create ( <span
class="methodparam">resource $device
)
参数
device
An
Open AL(Device)
resource (previously created by <span
class="function">openal_device_open).
返回值
Returns an
Open AL(Context)
resource on success or false on failure.
参见
- openal_device_open
- openal_context_destroy
openal_context_current
Make the specified context current
说明
bool <span
class="methodname">openal_context_current ( <span
class="methodparam">resource $context
)
参数
context
An
Open AL(Context)
resource (previously created by <span
class="function">openal_context_create).
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_context_create
openal_context_destroy
Destroys a context
说明
bool <span
class="methodname">openal_context_destroy ( <span
class="methodparam">resource $context
)
参数
context
An
Open AL(Context)
resource (previously created by <span
class="function">openal_context_create).
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_context_create
openal_context_process
Process the specified context
说明
bool <span
class="methodname">openal_context_process ( <span
class="methodparam">resource $context
)
参数
context
An
Open AL(Context)
resource (previously created by <span
class="function">openal_context_create).
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_context_create
- openal_context_current
- openal_context_suspend
openal_context_suspend
Suspend the specified context
说明
bool <span
class="methodname">openal_context_suspend ( <span
class="methodparam">resource $context
)
参数
context
An
Open AL(Context)
resource (previously created by <span
class="function">openal_context_create).
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_context_create
- openal_context_current
- openal_context_process
openal_device_close
Close an OpenAL device
说明
bool <span
class="methodname">openal_device_close ( <span
class="methodparam">resource $device
)
参数
device
An
Open AL(Device)
resource (previously created by <span
class="function">openal_device_open) to be closed.
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_device_open
openal_device_open
Initialize the OpenAL audio layer
说明
resource <span
class="methodname">openal_device_open ([ <span
class="methodparam">string
$device_desc ] )
参数
device_desc
Open an audio device optionally specified by device_desc. If
device_desc is not specified the first available audio device will be
used.
返回值
Returns an
Open AL(Device)
resource on success or false on failure.
参见
- openal_device_close
- openal_context_create
openal_listener_get
Retrieve a listener property
说明
mixed <span
class="methodname">openal_listener_get ( <span
class="methodparam">int $property )
参数
property
Property to retrieve, one of: AL_GAIN (float), AL_POSITION
(array(float,float,float)), AL_VELOCITY (array(float,float,float))
和 AL_ORIENTATION (array(float,float,float)).
返回值
Returns a float or array of floats (as appropriate) 或者在失败时返回
false.
参见
- openal_listener_set
openal_listener_set
Set a listener property
说明
bool <span
class="methodname">openal_listener_set ( <span
class="methodparam">int $property ,
mixed
$setting )
参数
property
Property to set, one of: AL_GAIN (float), AL_POSITION
(array(float,float,float)), AL_VELOCITY (array(float,float,float))
和 AL_ORIENTATION (array(float,float,float)).
setting
Value to set, either float, or an array of floats as appropriate.
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_listener_get
openal_source_create
Generate a source resource
说明
resource <span class="methodname">openal_source_create ( <span class="methodparam">void )
返回值
Returns an
Open AL(Source)
resource on success or false on failure.
参见
- openal_source_set
- openal_source_play
- openal_source_destroy
openal_source_destroy
Destroy a source resource
说明
bool <span
class="methodname">openal_source_destroy ( <span
class="methodparam">resource $source
)
参数
source
An
Open AL(Source)
resource (previously created by <span
class="function">openal_source_create).
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_source_create
openal_source_get
Retrieve an OpenAL source property
说明
mixed <span
class="methodname">openal_source_get ( <span
class="methodparam">resource $source
, int
$property )
参数
source
An
Open AL(Source)
resource (previously created by <span
class="function">openal_source_create).
property
Property to get, one of: AL_SOURCE_RELATIVE (int),
AL_SOURCE_STATE (int), AL_PITCH (float), AL_GAIN
(float), AL_MIN_GAIN (float), AL_MAX_GAIN (float),
AL_MAX_DISTANCE (float), AL_ROLLOFF_FACTOR (float),
AL_CONE_OUTER_GAIN (float), AL_CONE_INNER_ANGLE (float),
AL_CONE_OUTER_ANGLE (float), AL_REFERENCE_DISTANCE (float),
AL_POSITION (array(float,float,float)), AL_VELOCITY
(array(float,float,float)), AL_DIRECTION
(array(float,float,float)).
返回值
Returns the type associated with the property being retrieved
或者在失败时返回 false.
参见
- openal_source_create
- openal_source_set
- openal_source_play
openal_source_pause
Pause the source
说明
bool <span
class="methodname">openal_source_pause ( <span
class="methodparam">resource $source
)
参数
source
An
Open AL(Source)
resource (previously created by <span
class="function">openal_source_create).
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_source_stop
- openal_source_play
- openal_source_rewind
openal_source_play
Start playing the source
说明
bool <span
class="methodname">openal_source_play ( <span
class="methodparam">resource $source
)
参数
source
An
Open AL(Source)
resource (previously created by <span
class="function">openal_source_create).
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_source_stop
- openal_source_pause
- openal_source_rewind
openal_source_rewind
Rewind the source
说明
bool <span
class="methodname">openal_source_rewind ( <span
class="methodparam">resource $source
)
参数
source
An
Open AL(Source)
resource (previously created by <span
class="function">openal_source_create).
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_source_stop
- openal_source_pause
- openal_source_play
openal_source_set
Set source property
说明
bool <span
class="methodname">openal_source_set ( <span
class="methodparam">resource $source
, int
$property , <span
class="type">mixed $setting )
参数
source
An
Open AL(Source)
resource (previously created by <span
class="function">openal_source_create).
property
Property to set, one of: AL_BUFFER (OpenAL(Source)),
AL_LOOPING (bool), AL_SOURCE_RELATIVE (int),
AL_SOURCE_STATE (int), AL_PITCH (float), AL_GAIN
(float), AL_MIN_GAIN (float), AL_MAX_GAIN (float),
AL_MAX_DISTANCE (float), AL_ROLLOFF_FACTOR (float),
AL_CONE_OUTER_GAIN (float), AL_CONE_INNER_ANGLE (float),
AL_CONE_OUTER_ANGLE (float), AL_REFERENCE_DISTANCE (float),
AL_POSITION (array(float,float,float)), AL_VELOCITY
(array(float,float,float)), AL_DIRECTION
(array(float,float,float)).
setting
Value to assign to specified property. Refer to the description of
property for a description of the value(s) expected.
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_source_create
- openal_source_get
- openal_source_play
openal_source_stop
Stop playing the source
说明
bool <span
class="methodname">openal_source_stop ( <span
class="methodparam">resource $source
)
参数
source
An
Open AL(Source)
resource (previously created by <span
class="function">openal_source_create).
返回值
成功时返回 true, 或者在失败时返回 false。
参见
- openal_source_play
- openal_source_pause
- openal_source_rewind
openal_stream
Begin streaming on a source
说明
resource<span
class="type">false <span
class="methodname">openal_stream ( <span
class="methodparam">resource $source
, int
$format , <span
class="type">int $rate )
参数
source
An
Open AL(Source)
resource (previously created by <span
class="function">openal_source_create).
format
Format of data, one of: AL_FORMAT_MONO8, AL_FORMAT_MONO16,
AL_FORMAT_STEREO8 和 AL_FORMAT_STEREO16
rate
Frequency of data to stream given in Hz.
返回值
Returns a stream resource on success 或者在失败时返回 false.
参见
- openal_source_create
- fwrite
目录
- openal_buffer_create — Generate OpenAL buffer
- openal_buffer_data — Load a buffer with data
- openal_buffer_destroy — Destroys an OpenAL buffer
- openal_buffer_get — Retrieve an OpenAL buffer property
- openal_buffer_loadwav — Load a .wav file into a buffer
- openal_context_create — Create an audio processing context
- openal_context_current — Make the specified context current
- openal_context_destroy — Destroys a context
- openal_context_process — Process the specified context
- openal_context_suspend — Suspend the specified context
- openal_device_close — Close an OpenAL device
- openal_device_open — Initialize the OpenAL audio layer
- openal_listener_get — Retrieve a listener property
- openal_listener_set — Set a listener property
- openal_source_create — Generate a source resource
- openal_source_destroy — Destroy a source resource
- openal_source_get — Retrieve an OpenAL source property
- openal_source_pause — Pause the source
- openal_source_play — Start playing the source
- openal_source_rewind — Rewind the source
- openal_source_set — Set source property
- openal_source_stop — Stop playing the source
- openal_stream — Begin streaming on a source