#!/usr/bin/perl -w # # pVoice # # pVoice is a simple speech-application for disabled people. It displays buttons # with images, and by selecting them, the corresponding word will be spoken. # The images have to be in JPEG fileformat and will be resized to fit in the # defined $MAX_HEIGHT and $MAX_WIDTH. # # Words are grouped together in categories. These categories are defined in the # file $SOUNDDIR/$CATFILE which has the following format: # # Pagenumber can currently only be '1', categorynumbers start at '0', and # categoryname is a self-defineable name for the category. There has to be a # $SOUNDDIR/.$IMG_EXT and a directory $SOUNDDIR/. # For example: # if $SOUNDDIR is './data', and $IMG_EXT is set to 'jpg' and if the first # category is named 'people', there has to be a file ./data/people.jpg and # a directory ./data/people . # # In the directory there is a file $INDEXFILE, in which the # words of that category are defined. The $INDEXFILE has the following format: # # Pagenumbers start at 1, wordnumbers start at 0. The word must correspond with # a .$SOUND_EXT and .$IMG_EXT. For example: # if $SOUNDDIR is './data/, $IMG_EXT is 'jpg', $SOUND_EXT is 'wav' and the # current category is 'people', then if a word 'teacher' is listed in the # $INDEXFILE, there has to be a file ./data/people/teacher.jpg (the image) and # a file ./data/people/teacher.wav (the sound) # # There are three neccesary 'navigation-images', namely $UP_IMG, $NEXT_IMG and # $PREV_IMG, which have to reside in the $SOUNDDIR. They are used for # -respectively- going back to the category-page, going to the next wordpage and # going to the previous wordpage. # # To operate the program only two 'actions' are needed. A left mousebuttonclick # and a right mousebuttonclick. Disabled people (like my daughter) can generate # these mouseevents with various devices like a headsupport, which generates # a left click when the head goes left, and a right click when the head goes # right. # One thing to keep in mind is that the mousepointer itself should stay inside # the program-window, but pointed at the window-background - not at an image. # To browse through the images, keep clicking right. To activate an image # (either a word, a category or an up/left/right arrow), click left. # # It works on both Win32 platforms (tested on Win98) and Unix platforms (tested # on SuSE Linux 6.4 and 7.0) but requires the following modules: use Tk 800.017; use Tk::JPEG; use GD 1.27; use MIME::Base64; # And on unix-systems it requires the system command 'play' to play the .wav # files, and on Win32 systems, it requires Win32::Sound for the same purpose. # # Author: Jouke Visser # Last modification: March 15, 2001 # # Copyright (c) 2001, Jouke Visser # pVoice may be distributed under the terms of Perl itself (either using the # Artistic License or the GNU Public License) require Win32::Sound if $^O eq "MSWin32"; use strict;