~ubuntu-branches/ubuntu/oneiric/espeak/oneiric

« back to all changes in this revision

Viewing changes to src/synthdata.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2011-05-04 11:25:46 UTC
  • mfrom: (1.1.24 upstream) (5.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20110504112546-ykijzihgc7ybgzn2
Tags: 1.45.04-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Add gbp.conf for use with git buildpackage
  - Update the explanation of the -b command-line flag in the espeak manpage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (C) 2005 to 2010 by Jonathan Duddington                     *
 
2
 *   Copyright (C) 2005 to 2011 by Jonathan Duddington                     *
3
3
 *   email: jonsd@users.sourceforge.net                                    *
4
4
 *                                                                         *
5
5
 *   This program is free software; you can redistribute it and/or modify  *
35
35
#include "translate.h"
36
36
#include "wave.h"
37
37
 
38
 
const char *version_string = "1.44.04  14.Sep.10";
39
 
const int version_phdata  = 0x014404;
 
38
const char *version_string = "1.45.04  25.Apr.11";
 
39
const int version_phdata  = 0x014500;
40
40
 
41
41
int option_device_number = -1;
42
42
FILE *f_logespeak = NULL;
496
496
                else
497
497
                if(memcmp(buf,"pa_device",9)==0)
498
498
                {
499
 
                        sscanf(&buf[7],"%d",&option_device_number);
 
499
                        sscanf(&buf[10],"%d",&option_device_number);
500
500
                }
501
501
                else
502
502
                if(memcmp(buf,"soundicon",9)==0)
593
593
        int which;
594
594
        unsigned int data;
595
595
        int instn2;
 
596
        int count;
596
597
        PHONEME_TAB *ph;
597
598
        PHONEME_LIST *plist_this;
598
599
        static int ph_position[8] = {0, 1, 2, 3, 2, 0, 1, 3};  // prevPh, thisPh, nextPh, next2Ph, nextPhW, prevPhW, nextVowel, next2PhW
616
617
                        if(plist[0].sourceix)
617
618
                                return(false);
618
619
                }
 
620
                if(which==7)
 
621
                {
 
622
                        // nextPh2 not word boundary
 
623
                        if((plist[1].sourceix) || (plist[2].sourceix))
 
624
                                return(false);
 
625
                }
 
626
 
619
627
                if(which==6)
620
628
                {
621
629
                        // nextVowel, not word boundary
627
635
                                        break;
628
636
                        }
629
637
                }
630
 
                if(which==7)
631
 
                {
632
 
                        // nextPh2 not word boundary
633
 
                        if((plist[1].sourceix) || (plist[2].sourceix))
634
 
                                return(false);
635
 
                }
636
638
                else
637
639
                {
638
640
                        which = ph_position[which];
639
641
                }
 
642
 
640
643
                plist_this = plist;
641
644
                plist = &plist[which-1];
642
645
 
737
740
                        case 12:  // isVoiced
738
741
                                return((ph->type == phVOWEL) || (ph->type == phLIQUID) || (ph->phflags & phVOICED));
739
742
                        }
 
743
 
 
744
                        case 13:  // isFirstVowel
 
745
                                count = 0;
 
746
                                for(;;)
 
747
                                {
 
748
                                        if(plist->ph->type == phVOWEL)
 
749
                                                count++;
 
750
                                        if(plist->sourceix != 0)
 
751
                                                break;
 
752
                                        plist--;
 
753
                                }
 
754
                                return(count==1);
740
755
                        break;
741
756
 
742
757
                }