Re: need help with final callback

2012-07-19 Thread Gabriele Greco
Guys, I need your help with the last piece of my
 voice-by-computer program.  the appended section compiles to
 the binary xD that lets the user choose the gender,
 word-per-minute speed, delay-between-words, and pitch of th
 e voice.  Without this 'option' the user would type hello
 and hit enter, a male voice would sound thru the speakers.


I don't understand what is the object of your help request.

Your program seems to work.

Do you need to add a text entry to it so that you can write inside it and
call an external program to render the speech?

Do you want to integrate your speech system system-wide?

-- 
Bye,
 Gabry
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: need help with final callback

2012-07-19 Thread Gary Kline
On Thu, Jul 19, 2012 at 12:24:13PM +0200, Gabriele Greco wrote:
 Date: Thu, 19 Jul 2012 12:24:13 +0200
 From: Gabriele Greco gabriele.gr...@darts.it
 Subject: Re: need help with final callback
 To: Gary Kline kl...@thought.org, gtk-app-devel-list
  gtk-app-devel-list@gnome.org
 
 Guys, I need your help with the last piece of my
  voice-by-computer program.  the appended section compiles to
  the binary xD that lets the user choose the gender,
  word-per-minute speed, delay-between-words, and pitch of th
  e voice.  Without this 'option' the user would type hello
  and hit enter, a male voice would sound thru the speakers.
 
 
 I don't understand what is the object of your help request.
 
 Your program seems to work.
 
 Do you need to add a text entry to it so that you can write inside it and
 call an external program to render the speech?
 
 Do you want to integrate your speech system system-wide?
 
 -- 
 Bye,
  Gabry


Hi,

I want to hack this into my Options.  The rest of my vbc
programs work as it should: it lets the user type what he
wants to say into /usr/bin/gvim, and the computer voices his
words.  

The default now is that the voice is male; the program will 
add the option of changing the gender to female and tuning
the speed and other things.  I'm just just sure how how
integrate my dD.c with my vbc.c.  (Late last year as well as
in January and February, this year, I demo'd the main features
of vbc.  (I stopped for a few months because of shoulder
pain.  I am now ready to finish the project.)

I suppose I need  help in gluing this snippet into vbc.

gary



-- 
 Gary Kline  kl...@thought.org  http://www.thought.org  Public Service Unix
 Voice By Computer (for Universal Access): http:/www.thought.org/vbc
  The 8.57a release of Jottings: http://jottings.thought.org
 Twenty-five years of service to the Unix community.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


need help with final callback

2012-07-18 Thread Gary Kline

Guys, I need your help with the last piece of my
voice-by-computer program.  the appended section compiles to
the binary xD that lets the user choose the gender,
word-per-minute speed, delay-between-words, and pitch of th
e voice.  Without this 'option' the user would type hello
and hit enter, a male voice would sound thru the speakers. 
that's okay for *me*, nut probably not so if the user is a women
with impaired speech.  in short, this callback option lets the 
user select the gender and fine tune it.  

I will let future developers deal with the text editor.
right now, vim is fine.  

can anyone on this gtk list help me get this squared away?

thanks in advance,

gary kline



-- 
 Gary Kline  kl...@thought.org  http://www.thought.org  Public Service Unix
 Voice By Computer (for Universal Access): http:/www.thought.org/vbc
  The 8.57a release of Jottings: http://jottings.thought.org
 Twenty-six years of service to the Unix community.

/*

Compile::

gcc -Wall -Wextra -g dD.c -o xD `pkg-config --cflags gtk+-2.0` `pkg-config 
--libs gtk+-2.0`


 */
/* from here make this into:: Options callback */
#include gtk/gtk.h
#include string.h
#include stdlib.h   // for exit()

#define  PITCH 17.0
#define  SPEED 100.0
#define VOLUME 100.0
#define DELAY  3.0

enum 
{ 
  MALE, 
  FEMALE 
};

#define CONFIG /tmp/chatConfig
/* globals */
GtkWidget *gender_radio_male;
GtkWidget *gender_radio_female;
GtkWidget *pitch_scale1;
GtkWidget *speedWPM_scale2;
GtkWidget *volume_scale3;
GtkWidget *delay_scale4;
int valueGender = MALE;  // default 
double valuePitch, valueSpeed, valueVolume, valueDelay;
/* end globals */



/*
main prog writes default; this fn read and asks if ok
 */
void data_inout();

FILE *ifp, *ofp; /* in and out FILE pointers for fopen */


#define  FALSE(0)
#define  TRUE(~0)

static void
cb_gender_toggled (GtkToggleButton *button, gpointer userdata)
{

  int malefemale = (int)userdata;

  if (gtk_toggle_button_get_active (button))
{
if (malefemale == MALE)
   {
fprintf(stdout, Male \n);
   }
else if (malefemale == FEMALE)
   {
fprintf(stdout, Female \n);
   }
}
valueGender = malefemale;
fprintf(stderr,valueGender: %d\n,valueGender);
}

static void hscale_value_changed_pitch (GtkRange *hscale, GtkWindow 
*parentWindow)
{
valuePitch = gtk_range_get_value(hscale);
//fprintf(stderr,hscale pitch value: %g\n,valuePitch);
  if (valueGender == 0)
  {
fprintf(stdout, \ngender is Male\n);
  }
  else
  {
fprintf(stdout, \ngender is Female\n);
  }
  fprintf(stdout,In _pitch_: patch = %g, speed = %g, volume = %g delay = %g\n,
  valuePitch, valueSpeed, valueVolume, valueDelay);

}

static void hscale_value_changed_speed (GtkRange *hscale, GtkWindow 
*parentWindow)
{
valueSpeed = gtk_range_get_value(hscale);
fprintf(stderr,hscale speed value: %g\n,valueSpeed);
}

static void hscale_value_changed_volume (GtkRange *hscale, GtkWindow 
*parentWindow)
{
valueVolume = gtk_range_get_value(hscale);
fprintf(stderr,hscale volume value: %g\n,valueVolume);
}
static void hscale_value_changed_delay (GtkRange *hscale, GtkWindow 
*parentWindow)
{
valueDelay = gtk_range_get_value(hscale);
fprintf(stderr,hscale delay value: %g\n,valueDelay);
}

int
main (int argc, char *argv[])
{
 

  /*
   * Declare the GTK Widgets used in the program
   */
  GtkWidget *dialog;
  GtkWidget *main_hbox;   //hbox1

  GtkWidget *gender_frame;
  GtkWidget *gender_align;
  GtkWidget *gender_hbox;  // hbox2
  GtkWidget *params_frame;
  GtkWidget *params_align;

  GtkWidget *params_table;
  GtkWidget *temp_widget;
  GtkWidget *parent_window;



  /*
 Initialize GTK
   */
  gtk_init (argc, argv);

  parent_window = NULL; //Set to parent window if you want the dialog box
//to block access to the other windows in the app
//while it is open and running.


  dialog = gtk_dialog_new_with_buttons (Voice Settings, GTK_WINDOW 
(parent_window), 
0, 
GTK_STOCK_REVERT_TO_SAVED,  //revert button which
GTK_RESPONSE_CANCEL,//  returns a cancel response
GTK_STOCK_CLOSE,//close button which
GTK_RESPONSE_ACCEPT,//  returns an accept response
NULL// mark the end of our buttons (we could have 
more)
);

  gtk_window_set_title ( GTK_WINDOW ( dialog ) , VBC Espeak Options);
  gtk_widget_set_usize( GTK_WIDGET ( dialog ) , 600 , 400 );
  //GTK_WINDOW ( dialog ) -allow_shrink = TRUE;

  /*
   * dialog boxes have a vbox built in we can use 
   */
  main_hbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));

  /*
   * Create the first frame
   */
  gender_frame = gtk_frame_new (bVoice Gender/b);
  gtk_frame_set_shadow_type (GTK_FRAME (gender_frame), GTK_SHADOW_NONE);