Module: Ray::Audio

Defined in:
lib/ray/audio.rb,
ext/audio.c

Class Method Summary collapse

Class Method Details

.directionRay::Vector3

Returns The orientation of the listener.

Returns:



46
47
48
# File 'ext/audio.c', line 46

VALUE ray_audio_direction(VALUE self) {
  return ray_vector3_to_rb(say_audio_get_direction());
}

.direction=(dir) ⇒ Object

Sets the orientation of the listener.

Parameters:

  • dir (Ray::Vector3, #to_vector3)

    The new orientation of the listener.



55
56
57
58
# File 'ext/audio.c', line 55

VALUE ray_audio_set_direction(VALUE self, VALUE dir) {
  say_audio_set_direction(ray_convert_to_vector3(dir));
  return dir;
}

.posRay::Vector3

Returns The position of the listener.

Returns:



28
29
30
# File 'ext/audio.c', line 28

VALUE ray_audio_pos(VALUE self) {
  return ray_vector3_to_rb(say_audio_get_pos());
}

.pos=(pos) ⇒ Object

Sets the position of the listener. listener.

Parameters:

  • pos (Ray::Vector3, #to_vector3)

    The new position of the



38
39
40
41
# File 'ext/audio.c', line 38

VALUE ray_audio_set_pos(VALUE self, VALUE pos) {
  say_audio_set_pos(ray_convert_to_vector3(pos));
  return pos;
}

.positionObject



3
# File 'lib/ray/audio.rb', line 3

alias position  pos

.position=Object



4
# File 'lib/ray/audio.rb', line 4

alias position= pos=

.volumeFloat

is the maximum.

Returns:

  • (Float)

    The global volume. 0 is the minimum volume, whereas 100



9
10
11
# File 'ext/audio.c', line 9

VALUE ray_audio_volume(VALUE self) {
  return rb_float_new(say_audio_get_volume());
}

.volume=(val) ⇒ Object

Sets the global volume.

Parameters:

  • val (Float)

    The new value for the volume.



18
19
20
21
22
23
# File 'ext/audio.c', line 18

VALUE ray_audio_set_volume(VALUE self, VALUE value) {
  float volume = (float)NUM2DBL(value);
  say_audio_set_volume(volume);

  return value;
}