speech langage

any way to set the language of speech? I dont see anything in the doc. Thanks.

Hey @jmv38 this is planned, see here: http://codea.io/talk/discussion/comment/57171/#Comment_57171

@Jmv38 @Simeon I just type some words into my language (portuguese) and works fine!

@erickyamato that is great! Try also “hello wolrd” and “bonjour comment ça va?”, i doubt the poruguese accent will be adequate for this text? :wink:

@Jmv38, some words like my own name, the function say ‘Êrick’, using a “little trap”, I put ‘Érick’ and sounds the right way

Haha

thanks for very good update. i have tried to create text to speek with wav but it was not very good to listen. i like this update with speed. i like to have french woman voice too. @erick to say ingrid i write inegride and it’s works. for “game over” i don’t know lol.

@hpsoft speech.say(“gaillemoveur”)

ou encore: speech.say(“iouze ze force, liouke”)

@Jmv38 for “game over” it’s excellent

“what time is it” in english works
and “intime” in french too
it’s genial

try “zi end” → it’s very strange

etc. tél. bye a+ Mlle Eve Mgr. M. Dupont XXe
svp za zi SARL

lol!
speech.say(“gaillemoveur, zihainde”)

-- Test Speech Alea

function setup()
    
    displayMode(FULLSCREEN)
    textMode(CORNER)
    etape = 0
    phrase=""
    
    speech.rate = 0.3
    speech.volume = 1.0
    speech.pitch = 1.0
    speech.preDelay = 0.3
    
    -- Selon analyse fréquentielle
    
    voyelle={}
    voyelle[1]={"e","a","i"}
    voyelle[2]={"u","o"}
    voyelle[3]={"an","en","eu","oi","ou"}
    voyelle[4]={"ai","au","ei","in","un"}
    voyelle[5]={"iu","ui","un","é","è","ê","y"}
    
    consonne={}
    consonne[1]={"s","t","n","r","l"}
    consonne[2]={"d","m","p","c","v"}
    consonne[3]={"qu","g","gu"}
    consonne[4]={"b","f","j","h"}
    consonne[5]={"z","x","k","w"}
    
end

function draw()
    background(100, 0, 255, 255)
    fontSize(35)
    fill(136, 255, 0, 255)
    if etape==1 then else
        for i=1, 5 do
            mot=""
            for j=1, 1+math.random(3) do
                
                consrand=math.random(100)
                if consrand<60 then valcons=1 else
                    if consrand<80 then valcons=2 else
                        if consrand<90 then valcons=3 else
                            if consrand<97 then valcons=4 else
                                if consrand<101 then valcons=5 end
                            end
                        end
                    end
                end
                
                voyrand=math.random(100)
                if voyrand<60 then valvoy=1 else
                    if voyrand<80 then valvoy=2 else
                        if voyrand<90 then valvoy=3 else
                            if voyrand<97 then valvoy=4 else
                                if voyrand<101 then valvoy=5 end
                            end
                        end
                    end
                end
                
                mot=mot..consonne[valcons][math.random(#consonne[valcons])]
                if math.random(100)<70 then
                    mot=mot..voyelle[valvoy][math.random(#voyelle[valvoy])]
                end
                
            end
            phrase=phrase..mot.. " "
        end
        speech.say(phrase)
        etape = etape + 1
    end
    text(phrase,100,500)
end

wali lisoto tula hr tiupnt ?
sileb vega lagemin raque nlipa !

for now more like na’vi lol

in any case it’s good entrainement to pronunciation

-- Tester sa prononciation
-- et battre codea en vitesse maximale

supportedOrientations(LANDSCAPE_ANY)

function setup()
    
    font("Futura-CondensedMedium")
    fontSize(28)
    textMode(CORNER)
    
    first=1
    parler=0
    
    phrase="Appuyez sur New svp ..."
    
    parameter.action("Nouvelle phrase",New)
    parameter.action("Répéter la phrase",Repeat)
    parameter.number("vitesse",0,1,0.2)
    parameter.number("volume",0,1,0.7)
    parameter.number("tonalite",0.5,2,1)
    
    data =
    {
    "Alerte, Arlette allaite !",
    "Ces fiches-ci sont à statistiquer.",
    "Cinq capucins portaient sur leur sein le seing du saint-père",
    "Dis-moi, petite pomme, quand te dépetitepommeras-tu ?Je me dépetitepommerai quand toutes les petites pommes se dépetitepommeront. Or, comme toutes les petites pommes ne se dépetitepommeront jamais, petite pomme ne se dépetitepommera, jamais.",
    "J'ai un point dans mon pourpoint qui me pique et qui me pointe, si je savais celui qui a mis ce point dans mon pourpoint qui me pique et qui nie pointe, je lui mettrais un point dans son pourpoint qui le pique et qui le pointe.",
    "Je veux et j'exige dix-huit chemises fines et six fichus fins !",
    "J'excuse cet exquis exploit, tu excuses cet exploit exquis, il excuse",
    "La cavale au Valaque avala l'eau du lac. L'eau du lac lava la cavale au Valaque.",
    "La chemise du chimiste sèche.",
    "Le chétif chef coupe-tifs chante.",
    "Le juge rend justice.",
    "Le postiche de l'archiduchesse est plein de glaise.",
    "Le pragmatisme de l'astigmate agace.",
    "Mur gté, trou s'y fit, rat s'y mit.",
    "Papa boit dans les pins. Papa peint dans les bois. Dans les bois, papa boit et peint.",
    "Pour qui sont ces serpents qui sifflent sur vos têtes ?",
    "Pruneau cru, pruneau cuit.",
    "Rat vit rôt, rôt tenta rat, rat mit patte à rôt, rot brûla pattes à rat, rat secoua pattes et quitta rôt.",
    "Sachons que Zachée est un sage.",
    "Sage chasseur gé aux yeux chassieux, sachez chasser sans chien chose aisée,ce chat chauve caché sous ces six chiches souches de sauge sèche.",
    "Si la cathédrale se décathédraliserait, comment. la recathédraliserait-on, la cathédrale ? On la recathédraliserait comme on l'a décathédralisées, la cathédrale.",
    "Si l 'Américain se désaméricaniserait comment le réaméricaniserions-nous, l'Américain ? On le réaméricaniserait comme on l'a désaméricanisé, l'Américain.",
    "Six slips chics, six chics slips.",
    "Très grand doreur, quand redoreras-tu sûrement et d'un goût rare mes trente trois ou trente quatre cuillères d'or trop argentées ? Je redorerai sûrement quatre grandes cuillères d'or trop argentées, quand j'aurai redoré sûrement et d'un goût rare tes trente trois ou trente quatre autres grandes cuillères d'or trop argentées.",
    "Trois très gros, gras, grands rats gris grattent.",
    "Un ange qui songeait à changer son visage pour donner le change, se vit si changé, que loin de louanger ce changement, il jugea que tous les autres anges jugeraient que jamais ange ainsi changé ne rechangerait jamais, et jamais plus ange ne songea à se changer.",
    "Un gradé dragon dégrade un dragon gradé."
    }
end

function draw()
    background(20, 97, 218, 255)
    fill(227, 218, 54, 255)
    speech.rate=vitesse
    speech.volume=volume
    speech.pitch=tonalite
    phrasecut=string.sub(phrase,1,70) ; text(phrasecut,50,700)
    phrasecut=string.sub(phrase,71,140) ; text(phrasecut,50,660)
    phrasecut=string.sub(phrase,141,210) ; text(phrasecut,50,620)
    phrasecut=string.sub(phrase,211,280) ; text(phrasecut,50,580)
    phrasecut=string.sub(phrase,281,350) ; text(phrasecut,50,540)
    phrasecut=string.sub(phrase,351,420) ; text(phrasecut,50,500)
    if parler==1 then
        speech.say(phrase)
        parler=0
    end
end

function New()
    phrase=data[math.random(#data)]
    parler=1 ; first=0
end

function Repeat()
    if first==0 then parler=1 end
end

i want a english analyse version: voyelle={}, consonne={}. pls help me or tell me which is the best english analyse version, could it divide any word?

can you post an example of input text and expected output?

i mean a division way like syllable rule, for example, hap.py ex.er.cise but the above code, it occured to me maybe there is a way to combine words with vowels and consonants.