Module: MacSay

Defined in:
ext/macsay.c

Class Method Summary collapse

Class Method Details

.available_voicesObject



40
41
42
43
44
45
46
47
48
# File 'ext/macsay.c', line 40

static VALUE rb_macsay_available_voices(VALUE self) {
  VALUE voices;

  voices = rb_ary_new();

  available_voices(rb_macsay_available_voices0, (void *) voices);

  return voices;
}

.say(*args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'ext/macsay.c', line 7

static VALUE rb_macsay_say(int argc, VALUE *argv, VALUE self) {
  VALUE msg, voice;
  char *cmsg, *cvoice;

  rb_scan_args(argc, argv, "11", &msg, &voice);

  Check_Type(msg, T_STRING);
  cmsg = StringValuePtr(msg);

  if (NIL_P(voice)) {
    cvoice = NULL;
  } else {
    Check_Type(voice, T_STRING);
    cvoice = StringValuePtr(voice);
  }

  if (RSTRING_LEN(msg) < 1) {
    return Qnil;
  }

  say(cmsg, cvoice);

  return Qnil;
}