Module: Ray::Audio

Defined in:
ext/audio.c

Class Method Summary collapse

Class Method Details

.directionObject

See Also:



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;
}

.posObject

See Also:



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

Parameters:

  • pos (Ray::Vector3, #to_vector3)

    The new position of the listener.



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;
}

.volumeObject

See Also:



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

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, 0 being the minimum and 100 the maximum as well as the default.



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;
}