Help for this page

Select Code to Download


  1. or download this
    %voices = {
              'Microsoft Hedda Desktop - German' => 3,
    ...
              'Microsoft David Desktop - English (United States)' => 2,
              'Microsoft Huihui Desktop - Chinese (Simplified)' => 5
            };
    
  2. or download this
    use List::Util qw<first>;
    my $language='English';
    my $voice = $voices{ ( first { m/$language/ } keys %voices ) || '' };
    
  3. or download this
    %voices = {
              'Microsoft Huihui Desktop - Chinese (Simplified)' => 5
    ...
              'Microsoft Hazel Desktop - English (Great Britain)' => 1,
              'Microsoft Zira Desktop - English (United States)' => 0,
            };