Method: Whisper.lang_str

Defined in:
ext/ruby_whisper.c

.lang_str(lang_id) ⇒ String

Returns:

  • (String)


67
68
69
70
71
72
73
74
# File 'ext/ruby_whisper.c', line 67

static VALUE ruby_whisper_s_lang_str(VALUE self, VALUE id) {
  const int lang_id = NUM2INT(id);
  const char * str = whisper_lang_str(lang_id);
  if (NULL == str) {
    rb_raise(rb_eIndexError, "id %d outside of language id", lang_id);
  }
  return rb_str_new2(str);
}