File Coverage

blib/lib/Pod/SpeakIt/MacSpeech.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             # $Id$
2             package Pod::SpeakIt::MacSpeech;
3 1     1   831 use strict;
  1         4  
  1         43  
4 1     1   6 use base qw(Pod::PseudoPod);
  1         2  
  1         772  
5              
6             use warnings;
7             no warnings;
8              
9             use subs qw();
10             use vars qw($VERSION);
11              
12             use Mac::Files;
13             use Mac::Speech;
14              
15             my $voice = $Mac::Speech::Voice{Victoria};
16             my $channel = NewSpeechChannel($voice);
17             SetSpeechPitch($channel, 0.9*GetSpeechPitch($channel) );
18             SetSpeechRate( $channel, 0.7*GetSpeechRate($channel) );
19              
20             $VERSION = '0.11';
21              
22             =head1 NAME
23              
24             Pod::SpeakIt::MacSpeech - This is the description
25              
26             =head1 SYNOPSIS
27              
28             use Pod::SpeakIt::MacSpeech;
29              
30             =head1 DESCRIPTION
31              
32             ***THIS IS ALPHA SOFTWARE. MAJOR PARTS WILL CHANGE***
33              
34             This module overrides and extends C to read
35             Pod aloud.
36              
37             =cut
38              
39             sub DESTROY
40             {
41             $_[0]->SUPER::DESTROY;
42             DisposeSpeechChannel($channel)
43             }
44            
45             sub handle_text { $_[0]{'scratch'} .= $_[1] }
46              
47             sub speak_it
48             {
49             SpeakText( $channel, $_[0]->{'scratch'} );
50             sleep 1 while SpeechBusy();
51             $_[0]->{'scratch'} = '';
52             sleep 1;
53            
54             return;
55             }
56              
57             sub document_header
58             {
59             print STDERR "HERE I AM";
60             }
61              
62             sub start_head0 { }
63             sub start_head1 { }
64             sub start_head2 { }
65             sub start_head3 { }
66             sub start_head4 { }
67            
68             sub end_head0 { $_[0]->speak_it }
69             sub end_head1 { $_[0]->speak_it }
70             sub end_head2 { $_[0]->speak_it }
71              
72             sub end_Para { $_[0]->speak_it }
73            
74             sub end_Verbatim
75             {
76             sleep 1;
77             $_[0]->{scratch} = "Code section (skipping)";
78             $_[0]->speak_it;
79             sleep 1;
80             }
81              
82             =head1 TO DO
83              
84             =over 4
85              
86             =item * handle item lists
87              
88             =item * different voices for headings and paras and code
89              
90             =item * configure voices, pitch, and rate
91              
92             =back
93              
94             =head1 SEE ALSO
95              
96             L, L
97              
98             =head1 SOURCE AVAILABILITY
99              
100             This source is part of a SourceForge project which always has the
101             latest sources in SVN, as well as all of the previous releases.
102              
103             http://sourceforge.net/projects/brian-d-foy/
104              
105             If, for some reason, I disappear from the world, one of the other
106             members of the project can shepherd this module appropriately.
107              
108             =head1 AUTHOR
109              
110             brian d foy, C<< >>
111              
112             =head1 COPYRIGHT AND LICENSE
113              
114             Copyright (c) 2007-2008, brian d foy, All Rights Reserved.
115              
116             You may redistribute this under the same terms as Perl itself.
117              
118             =cut
119              
120             1;