From: Christian Boos Date: 2002-02-06T04:09:58+09:00 Subject: RE: Ruby extension for IBM Via Voice TTS Hello, > -----Original Message----- > From: Mike Hall [mailto:mghall@enteract.com] > Sent: Tuesday, February 05, 2002 8:01 PM > To: ruby-talk ML; undisclosed-recipients: ; > Subject: Ruby extension for IBM Via Voice TTS > > > I just put up a simple Ruby extension for IBM's Via Voice > text-to-speech synthesizer. It's on my home page, listed below. > Here's the ViaVoice page: http://www.ibm.com/software/speech/dev > > I have some "style' questions, though. > > There's many voice and synthesis parameters that control > the speaking voice, like pitch, volume, speed, head, gender, etc. > > What's a good "Ruby way" to add these? > > - define general set_param / get_param methods > and write higher-level methods in Ruby? > > - define the individual methods in C? > *> - make them look and act like instance variables? > ... by using rb_define_virtual_variable? Excerpt from the Pickaxe Book: void rb_define_virtual_variable(const char *name, VALUE(*getter)(), void(*setter)()") Exports a virtual variable to Ruby namespace as the global $name. No actual storage exists for the variable; attempts to get and set the value will call the given functions with the prototypes: VALUE getter(ID id, VALUE *data, struct global_entry *entry); void setter(VALUE value, ID id, VALUE *data, struct global_entry *entry); Hope this helps! -- Christian