openal_buffer_create

Generate OpenAL buffer

说明

resource openal_buffer_create ( 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 openal_buffer_data ( resource $buffer , int $format , string $data , int $freq )

参数

buffer
An Open AL(Buffer) resource (previously created by openal_buffer_create).

format
Format of data, one of: AL_FORMAT_MONO8, AL_FORMAT_MONO16, AL_FORMAT_STEREO8AL_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 openal_buffer_destroy ( resource $buffer )

参数

buffer
An Open AL(Buffer) resource (previously created by openal_buffer_create).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_buffer_create

openal_buffer_get

Retrieve an OpenAL buffer property

说明

int openal_buffer_get ( resource $buffer , int $property )

参数

buffer
An Open AL(Buffer) resource (previously created by openal_buffer_create).

property
Specific property, one of: AL_FREQUENCY, AL_BITS, AL_CHANNELSAL_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 openal_buffer_loadwav ( resource $buffer , string $wavfile )

参数

buffer
An Open AL(Buffer) resource (previously created by 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 openal_context_create ( resource $device )

参数

device
An Open AL(Device) resource (previously created by 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 openal_context_current ( resource $context )

参数

context
An Open AL(Context) resource (previously created by openal_context_create).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_context_create

openal_context_destroy

Destroys a context

说明

bool openal_context_destroy ( resource $context )

参数

context
An Open AL(Context) resource (previously created by openal_context_create).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_context_create

openal_context_process

Process the specified context

说明

bool openal_context_process ( resource $context )

参数

context
An Open AL(Context) resource (previously created by openal_context_create).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_context_create
  • openal_context_current
  • openal_context_suspend

openal_context_suspend

Suspend the specified context

说明

bool openal_context_suspend ( resource $context )

参数

context
An Open AL(Context) resource (previously created by openal_context_create).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_context_create
  • openal_context_current
  • openal_context_process

openal_device_close

Close an OpenAL device

说明

bool openal_device_close ( resource $device )

参数

device
An Open AL(Device) resource (previously created by openal_device_open) to be closed.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_device_open

openal_device_open

Initialize the OpenAL audio layer

说明

resource openal_device_open ([ 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 openal_listener_get ( 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 openal_listener_set ( 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 openal_source_create ( 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 openal_source_destroy ( resource $source )

参数

source
An Open AL(Source) resource (previously created by openal_source_create).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_source_create

openal_source_get

Retrieve an OpenAL source property

说明

mixed openal_source_get ( resource $source , int $property )

参数

source
An Open AL(Source) resource (previously created by 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 openal_source_pause ( resource $source )

参数

source
An Open AL(Source) resource (previously created by openal_source_create).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_source_stop
  • openal_source_play
  • openal_source_rewind

openal_source_play

Start playing the source

说明

bool openal_source_play ( resource $source )

参数

source
An Open AL(Source) resource (previously created by openal_source_create).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_source_stop
  • openal_source_pause
  • openal_source_rewind

openal_source_rewind

Rewind the source

说明

bool openal_source_rewind ( resource $source )

参数

source
An Open AL(Source) resource (previously created by openal_source_create).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_source_stop
  • openal_source_pause
  • openal_source_play

openal_source_set

Set source property

说明

bool openal_source_set ( resource $source , int $property , mixed $setting )

参数

source
An Open AL(Source) resource (previously created by 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 openal_source_stop ( resource $source )

参数

source
An Open AL(Source) resource (previously created by openal_source_create).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • openal_source_play
  • openal_source_pause
  • openal_source_rewind

openal_stream

Begin streaming on a source

说明

resource openal_stream ( resource $source , int $format , int $rate )

参数

source
An Open AL(Source) resource (previously created by openal_source_create).

format
Format of data, one of: AL_FORMAT_MONO8, AL_FORMAT_MONO16, AL_FORMAT_STEREO8AL_FORMAT_STEREO16

rate
Frequency of data to stream given in Hz.

返回值

Returns a stream resource on success 或者在失败时返回 FALSE.

参见

  • openal_source_create
  • fwrite

目录