Synthese vocale

Soyez le premier à donner votre avis sur cette source.

Snippet vu 3 176 fois - Téléchargée 15 fois

Contenu du snippet

Le plus dur est de trouver une voix française SAPI 5.3,si vous n'avez pas windows 8.
c'est içi:http://www.zebulon.fr/astuces/200-synthese-vocale-windows-en-francais.html
Les fichiers s'appelent :MSReaderSetupFRA.exe et ReaderTTSInstallFRA.exe
aller dans le panneau de configuration,choisir la voix par défaut.
Le code est içi.
les fichiers inclus sont sur mon site.

Source / Exemple :


.NOLIST			
	include sdk32.inc
	include sapi.sdk	

	InitInstance PROTO :DWORD
	.const
	.data
	CLSID_SpVoice GUID sCLSID_SpVoice
	IID_ISpVoice GUID sIID_ISpVoice
	ppvISpVoice dd 0
	Text_intro    db "Bonjour,je suis la",0	
	Speech_Buffer  dw 1024 dup(?)	
	.code

	start:
	invoke InitInstance,1
	;---- code here --------
	invoke  CoCreateInstance,addr CLSID_SpVoice,NULL,CLSCTX_ALL,addr IID_ISpVoice,addr ppvISpVoice
	invoke  MultiByteToWideChar,NULL,NULL,addr Text_intro,-1,addr Speech_Buffer,1024
	ISpVoice Speak,addr Speech_Buffer,SPF_DEFAULT,NULL	
	ISpVoice Release
	
	invoke InitInstance,0	
	invoke ExitProcess,0
InitInstance PROC  init:DWORD 
	Local  retour:DWORD
	mov retour,1
	.if init == 1
		invoke GetModuleHandle,NULL
		mov hInstance,eax	
		invoke CoInitializeEx ,NULL, COINIT_APARTMENTTHREADED ;COINIT_MULTITHREADED  ;Thread 3		
	.else
		invoke CoUninitialize	
	.endif

FindeInitInstance:
	mov eax,retour
	ret
InitInstance endp
;code_invalid_parameter
;################################################################	
end start		
;-------------------------------------------------------------

sLIBID_SpeechLib	TEXTEQU	<{0C866CA3Ah,032F7h,011D2h,{096h,002h,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sIID_ISpeechDataKey	TEXTEQU	<{0CE17C09Bh,04EFAh,044D5h,{0A4h,0C9h,059h,0D9h,058h,05Ah,0B0h,0CDh}}>
sIID_ISpeechObjectToken	TEXTEQU	<{0C74A3ADCh,0B727h,04500h,{0A8h,04Ah,0B5h,026h,072h,01Ch,08Bh,08Ch}}>
sIID_ISpeechObjectTokenCategory	TEXTEQU	<{0CA7EAC50h,02D01h,04145h,{086h,0D4h,05Ah,0E7h,0D7h,00Fh,044h,069h}}>
sIID_ISpeechObjectTokens	TEXTEQU	<{09285B776h,02E7Bh,04BC0h,{0B5h,03Eh,058h,00Eh,0B6h,0FAh,096h,07Fh}}>
sIID_ISpeechAudioBufferInfo	TEXTEQU	<{011B103D8h,01142h,04EDFh,{0A0h,093h,082h,0FBh,039h,015h,0F8h,0CCh}}>
sIID_ISpeechAudioStatus	TEXTEQU	<{0C62D9C91h,07458h,047F6h,{086h,02Dh,01Eh,0F8h,06Fh,0B0h,0B2h,078h}}>
sIID_ISpeechAudioFormat	TEXTEQU	<{0E6E9C590h,03E18h,040E3h,{082h,099h,006h,01Fh,098h,0BDh,0E7h,0C7h}}>
sIID_ISpeechWaveFormatEx	TEXTEQU	<{07A1EF0D5h,01581h,04741h,{088h,0E4h,020h,09Ah,049h,0F1h,01Ah,010h}}>
sIID_ISpeechBaseStream	TEXTEQU	<{06450336Fh,07D49h,04CEDh,{080h,097h,049h,0D6h,0DEh,0E3h,072h,094h}}>
sIID_ISpeechFileStream	TEXTEQU	<{0AF67F125h,0AB39h,04E93h,{0B4h,0A2h,0CCh,02Eh,066h,0E1h,082h,0A7h}}>
sIID_ISpeechMemoryStream	TEXTEQU	<{0EEB14B68h,0808Bh,04ABEh,{0A5h,0EAh,0B5h,01Dh,0A7h,058h,080h,008h}}>
sIID_ISpeechCustomStream	TEXTEQU	<{01A9E9F4Fh,0104Fh,04DB8h,{0A1h,015h,0EFh,0D7h,0FDh,00Ch,097h,0AEh}}>
sIID_ISpeechAudio	TEXTEQU	<{0CFF8E175h,0019Eh,011D3h,{0A0h,08Eh,000h,0C0h,04Fh,08Eh,0F9h,0B5h}}>
sIID_ISpeechMMSysAudio	TEXTEQU	<{03C76AF6Dh,01FD7h,04831h,{081h,0D1h,03Bh,071h,0D5h,0A1h,03Ch,044h}}>
sIID_ISpeechVoice	TEXTEQU	<{0269316D8h,057BDh,011D2h,{09Eh,0EEh,000h,0C0h,04Fh,079h,073h,096h}}>
sIID_ISpeechVoiceStatus	TEXTEQU	<{08BE47B07h,057F6h,011D2h,{09Eh,0EEh,000h,0C0h,04Fh,079h,073h,096h}}>
sDIID__ISpeechVoiceEvents	TEXTEQU	<{0A372ACD1h,03BEFh,04BBDh,{08Fh,0FBh,0CBh,03Eh,02Bh,041h,06Ah,0F8h}}>
sIID_ISpeechRecognizer	TEXTEQU	<{02D5F1C0Ch,0BD75h,04B08h,{094h,078h,03Bh,011h,0FEh,0A2h,058h,06Ch}}>
sIID_ISpeechRecognizerStatus	TEXTEQU	<{0BFF9E781h,053ECh,0484Eh,{0BBh,08Ah,00Eh,01Bh,055h,051h,0E3h,05Ch}}>
sIID_ISpeechRecoContext	TEXTEQU	<{0580AA49Dh,07E1Eh,04809h,{0B8h,0E2h,057h,0DAh,080h,061h,004h,0B8h}}>
sIID_ISpeechRecoGrammar	TEXTEQU	<{0B6D6F79Fh,02158h,04E50h,{0B5h,0BCh,09Ah,09Ch,0CDh,085h,02Ah,009h}}>
sIID_ISpeechGrammarRules	TEXTEQU	<{06FFA3B44h,0FC2Dh,040D1h,{08Ah,0FCh,032h,091h,01Ch,07Fh,01Ah,0D1h}}>
sIID_ISpeechGrammarRule	TEXTEQU	<{0AFE719CFh,05DD1h,044F2h,{099h,09Ch,07Ah,039h,09Fh,01Ch,0FCh,0CCh}}>
sIID_ISpeechGrammarRuleState	TEXTEQU	<{0D4286F2Ch,0EE67h,045AEh,{0B9h,028h,028h,0D6h,095h,036h,02Eh,0DAh}}>
sIID_ISpeechGrammarRuleStateTransitions	TEXTEQU	<{0EABCE657h,075BCh,044A2h,{0AAh,07Fh,0C5h,064h,076h,074h,029h,063h}}>
sIID_ISpeechGrammarRuleStateTransition	TEXTEQU	<{0CAFD1DB1h,041D1h,04A06h,{098h,063h,0E2h,0E8h,01Dh,0A1h,07Ah,09Ah}}>
sIID_ISpeechTextSelectionInformation	TEXTEQU	<{03B9C7E7Ah,06EEEh,04DEDh,{090h,092h,011h,065h,072h,079h,0ADh,0BEh}}>
sIID_ISpeechRecoResult	TEXTEQU	<{0ED2879CFh,0CED9h,04EE6h,{0A5h,034h,0DEh,001h,091h,0D5h,046h,08Dh}}>
sIID_ISpeechRecoResultTimes	TEXTEQU	<{062B3B8FBh,0F6E7h,041BEh,{0BDh,0CBh,005h,06Bh,01Ch,029h,0EFh,0C0h}}>
sIID_ISpeechPhraseInfo	TEXTEQU	<{0961559CFh,04E67h,04662h,{08Bh,0F0h,0D9h,03Fh,01Fh,0CDh,061h,0B3h}}>
sIID_ISpeechPhraseRule	TEXTEQU	<{0A7BFE112h,0A4A0h,048D9h,{0B6h,002h,0C3h,013h,084h,03Fh,069h,064h}}>
sIID_ISpeechPhraseRules	TEXTEQU	<{09047D593h,001DDh,04B72h,{081h,0A3h,0E4h,0A0h,0CAh,069h,0F4h,007h}}>
sIID_ISpeechPhraseProperties	TEXTEQU	<{008166B47h,0102Eh,04B23h,{0A5h,099h,0BDh,0B9h,08Dh,0BFh,0D1h,0F4h}}>
sIID_ISpeechPhraseProperty	TEXTEQU	<{0CE563D48h,0961Eh,04732h,{0A2h,0E1h,037h,08Ah,042h,0B4h,030h,0BEh}}>
sIID_ISpeechPhraseElements	TEXTEQU	<{00626B328h,03478h,0467Dh,{0A0h,0B3h,0D0h,085h,03Bh,093h,0DDh,0A3h}}>
sIID_ISpeechPhraseElement	TEXTEQU	<{0E6176F96h,0E373h,04801h,{0B2h,023h,03Bh,062h,0C0h,068h,0C0h,0B4h}}>
sIID_ISpeechPhraseReplacements	TEXTEQU	<{038BC662Fh,02257h,04525h,{095h,09Eh,020h,069h,0D2h,059h,06Ch,005h}}>
sIID_ISpeechPhraseReplacement	TEXTEQU	<{02890A410h,053A7h,04FB5h,{094h,0ECh,006h,0D4h,099h,08Eh,03Dh,002h}}>
sIID_ISpeechPhraseAlternates	TEXTEQU	<{0B238B6D5h,0F276h,04C3Dh,{0A6h,0C1h,029h,074h,080h,01Ch,03Ch,0C2h}}>
sIID_ISpeechPhraseAlternate	TEXTEQU	<{027864A2Ah,02B9Fh,04CB8h,{092h,0D3h,00Dh,027h,022h,0FDh,01Eh,073h}}>
sDIID__ISpeechRecoContextEvents	TEXTEQU	<{07B8FCB42h,00E9Dh,04F00h,{0A0h,048h,07Bh,004h,0D6h,017h,09Dh,03Dh}}>
sIID_ISpeechLexicon	TEXTEQU	<{03DA7627Ah,0C7AEh,04B23h,{087h,008h,063h,08Ch,050h,036h,02Ch,025h}}>
sIID_ISpeechLexiconWords	TEXTEQU	<{08D199862h,0415Eh,047D5h,{0ACh,04Fh,0FAh,0A6h,008h,0B4h,024h,0E6h}}>
sIID_ISpeechLexiconWord	TEXTEQU	<{04E5B933Ch,0C9BEh,048EDh,{088h,042h,01Eh,0E5h,01Bh,0B1h,0D4h,0FFh}}>
sIID_ISpeechLexiconPronunciations	TEXTEQU	<{072829128h,05682h,04704h,{0A0h,0D4h,03Eh,02Bh,0B6h,0F2h,0EAh,0D3h}}>
sIID_ISpeechLexiconPronunciation	TEXTEQU	<{095252C5Dh,09E43h,04F4Ah,{098h,099h,048h,0EEh,073h,035h,02Fh,09Fh}}>
sIID_ISpeechPhraseInfoBuilder	TEXTEQU	<{03B151836h,0DF3Ah,04E0Ah,{084h,06Ch,0D2h,0ADh,0C9h,033h,043h,033h}}>
sIID_ISpeechPhoneConverter	TEXTEQU	<{0C3E4F353h,0433Fh,043D6h,{089h,0A1h,06Ah,062h,0A7h,005h,04Ch,03Dh}}>
sIID_ISpNotifySink	TEXTEQU	<{0259684DCh,037C3h,011D2h,{096h,003h,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sIID_ISpNotifyTranslator	TEXTEQU	<{0ACA16614h,05D3Dh,011D2h,{096h,00Eh,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sIID_ISpDataKey	TEXTEQU	<{014056581h,0E16Ch,011D2h,{0BBh,090h,000h,0C0h,04Fh,08Eh,0E6h,0C0h}}>
sIID_ISpObjectTokenCategory	TEXTEQU	<{02D3D3845h,039AFh,04850h,{0BBh,0F9h,040h,0B4h,097h,080h,001h,01Dh}}>
sIID_IEnumSpObjectTokens	TEXTEQU	<{006B64F9Eh,07FDAh,011D2h,{0B4h,0F2h,000h,0C0h,04Fh,079h,073h,096h}}>
sIID_ISpObjectToken	TEXTEQU	<{014056589h,0E16Ch,011D2h,{0BBh,090h,000h,0C0h,04Fh,08Eh,0E6h,0C0h}}>
sIID_IServiceProvider	TEXTEQU	<{06D5140C1h,07436h,011CEh,{080h,034h,000h,0AAh,000h,060h,009h,0FAh}}>
sIID_ISpResourceManager	TEXTEQU	<{093384E18h,05014h,043D5h,{0ADh,0BBh,0A7h,08Eh,005h,059h,026h,0BDh}}>
sIID_ISpStreamFormat	TEXTEQU	<{0BED530BEh,02606h,04F4Dh,{0A1h,0C0h,054h,0C5h,0CDh,0A5h,056h,06Fh}}>
sIID_ISpStreamFormatConverter	TEXTEQU	<{0678A932Ch,0EA71h,04446h,{09Bh,041h,078h,0FDh,0A6h,028h,00Ah,029h}}>
sIID_ISpNotifySource	TEXTEQU	<{05EFF4AEFh,08487h,011D2h,{096h,01Ch,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sIID_ISpEventSource	TEXTEQU	<{0BE7A9CCEh,05F9Eh,011D2h,{096h,00Fh,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sIID_ISpEventSink	TEXTEQU	<{0BE7A9CC9h,05F9Eh,011D2h,{096h,00Fh,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sIID_ISpObjectWithToken	TEXTEQU	<{05B559F40h,0E952h,011D2h,{0BBh,091h,000h,0C0h,04Fh,08Eh,0E6h,0C0h}}>
sIID_ISpAudio	TEXTEQU	<{0C05C768Fh,0FAE8h,04EC2h,{08Eh,007h,033h,083h,021h,0C1h,024h,052h}}>
sIID_ISpMMSysAudio	TEXTEQU	<{015806F6Eh,01D70h,04B48h,{098h,0E6h,03Bh,01Ah,000h,075h,009h,0ABh}}>
sIID_ISpStream	TEXTEQU	<{012E3CCA9h,07518h,044C5h,{0A5h,0E7h,0BAh,05Ah,079h,0CBh,092h,09Eh}}>
sIID_ISpVoice	TEXTEQU	<{06C44DF74h,072B9h,04992h,{0A1h,0ECh,0EFh,099h,06Eh,004h,022h,0D4h}}>
sIID_ISpRecoContext	TEXTEQU	<{0F740A62Fh,07C15h,0489Eh,{082h,034h,094h,00Ah,033h,0D9h,027h,02Dh}}>
sIID_ISpProperties	TEXTEQU	<{05B4FB971h,0B115h,04DE1h,{0ADh,097h,0E4h,082h,0E3h,0BFh,06Eh,0E4h}}>
sIID_ISpRecognizer	TEXTEQU	<{0C2B5F241h,0DAA0h,04507h,{09Eh,016h,05Ah,01Eh,0AAh,02Bh,07Ah,05Ch}}>
sIID_ISpPhrase	TEXTEQU	<{01A5C0354h,0B621h,04B5Ah,{087h,091h,0D3h,006h,0EDh,037h,09Eh,053h}}>
sIID_ISpGrammarBuilder	TEXTEQU	<{08137828Fh,0591Ah,04A42h,{0BEh,058h,049h,0EAh,07Eh,0BAh,0ACh,068h}}>
sIID_ISpRecoGrammar	TEXTEQU	<{02177DB29h,07F45h,047D0h,{085h,054h,006h,07Eh,091h,0C8h,005h,002h}}>
sIID_ISpRecoResult	TEXTEQU	<{020B053BEh,0E235h,043CDh,{09Ah,02Ah,08Dh,017h,0A4h,08Bh,078h,042h}}>
sIID_ISpPhraseAlt	TEXTEQU	<{08FCEBC98h,04E49h,04067h,{09Ch,06Ch,0D8h,06Ah,00Eh,009h,02Eh,03Dh}}>
sIID_ISpLexicon	TEXTEQU	<{0DA41A7C2h,05383h,04DB2h,{091h,06Bh,06Ch,017h,019h,0E3h,0DBh,058h}}>
sIID_ISpPhoneConverter	TEXTEQU	<{08445C581h,00CACh,04A38h,{0ABh,0FEh,09Bh,02Ch,0E2h,082h,064h,055h}}>
sCLSID_SpNotifyTranslator	TEXTEQU	<{0E2AE5372h,05D40h,011D2h,{096h,00Eh,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sCLSID_SpObjectTokenCategory	TEXTEQU	<{0A910187Fh,00C7Ah,045ACh,{092h,0CCh,059h,0EDh,0AFh,0B7h,07Bh,053h}}>
sCLSID_SpObjectToken	TEXTEQU	<{0EF411752h,03736h,04CB4h,{09Ch,08Ch,08Eh,0F4h,0CCh,0B5h,08Eh,0FEh}}>
sCLSID_SpResourceManager	TEXTEQU	<{096749373h,03391h,011D2h,{09Eh,0E3h,000h,0C0h,04Fh,079h,073h,096h}}>
sCLSID_SpStreamFormatConverter	TEXTEQU	<{07013943Ah,0E2ECh,011D2h,{0A0h,086h,000h,0C0h,04Fh,08Eh,0F9h,0B5h}}>
sCLSID_SpMMAudioEnum	TEXTEQU	<{0AB1890A0h,0E91Fh,011D2h,{0BBh,091h,000h,0C0h,04Fh,08Eh,0E6h,0C0h}}>
sCLSID_SpMMAudioIn	TEXTEQU	<{0CF3D2E50h,053F2h,011D2h,{096h,00Ch,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sCLSID_SpMMAudioOut	TEXTEQU	<{0A8C680EBh,03D32h,011D2h,{09Eh,0E7h,000h,0C0h,04Fh,079h,073h,096h}}>
sCLSID_SpRecPlayAudio	TEXTEQU	<{0FEE225FCh,07AFDh,045E9h,{095h,0D0h,05Ah,031h,080h,079h,0D9h,011h}}>
sCLSID_SpStream	TEXTEQU	<{0715D9C59h,04442h,011D2h,{096h,005h,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sCLSID_SpVoice	TEXTEQU	<{096749377h,03391h,011D2h,{09Eh,0E3h,000h,0C0h,04Fh,079h,073h,096h}}>
sCLSID_SpSharedRecoContext	TEXTEQU	<{047206204h,05ECAh,011D2h,{096h,00Fh,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sCLSID_SpInprocRecognizer	TEXTEQU	<{041B89B6Bh,09399h,011D2h,{096h,023h,000h,0C0h,04Fh,08Eh,0E6h,028h}}>
sCLSID_SpSharedRecognizer	TEXTEQU	<{03BEE4890h,04FE9h,04A37h,{08Ch,01Eh,05Eh,07Eh,012h,079h,01Ch,01Fh}}>
sCLSID_SpLexicon	TEXTEQU	<{00655E396h,025D0h,011D3h,{09Ch,026h,000h,0C0h,04Fh,08Eh,0F8h,07Ch}}>
sCLSID_SpUnCompressedLexicon	TEXTEQU	<{0C9E37C15h,0DF92h,04727h,{085h,0D6h,072h,0E5h,0EEh,0B6h,099h,05Ah}}>
sCLSID_SpCompressedLexicon	TEXTEQU	<{090903716h,02F42h,011D3h,{09Ch,026h,000h,0C0h,04Fh,08Eh,0F8h,07Ch}}>
sCLSID_SpPhoneConverter	TEXTEQU	<{09185F743h,01143h,04C28h,{086h,0B5h,0BFh,0F1h,04Fh,020h,0E5h,0C8h}}>
sCLSID_SpNullPhoneConverter	TEXTEQU	<{0455F24E9h,07396h,04A16h,{097h,015h,07Ch,00Fh,0DBh,0E3h,0EFh,0E3h}}>
sCLSID_SpTextSelectionInformation	TEXTEQU	<{00F92030Ah,0CBFDh,04AB8h,{0A1h,064h,0FFh,059h,085h,054h,07Fh,0F6h}}>
sCLSID_SpPhraseInfoBuilder	TEXTEQU	<{0C23FC28Dh,0C55Fh,04720h,{08Bh,032h,091h,0F7h,03Ch,02Bh,0D5h,0D1h}}>
sCLSID_SpAudioFormat	TEXTEQU	<{09EF96870h,0E160h,04792h,{082h,00Dh,048h,0CFh,006h,049h,0E4h,0ECh}}>
sCLSID_SpWaveFormatEx	TEXTEQU	<{0C79A574Ch,063BEh,044B9h,{080h,01Fh,028h,03Fh,087h,0F8h,098h,0BEh}}>
sCLSID_SpInProcRecoContext	TEXTEQU	<{073AD6842h,0ACE0h,045E8h,{0A4h,0DDh,087h,095h,088h,01Ah,02Ch,02Ah}}>
sCLSID_SpCustomStream	TEXTEQU	<{08DBEF13Fh,01948h,04AA8h,{08Ch,0F0h,004h,08Eh,0EBh,0EDh,095h,0D8h}}>
sCLSID_SpFileStream	TEXTEQU	<{0947812B3h,02AE1h,04644h,{0BAh,086h,09Eh,090h,0DEh,0D7h,0ECh,091h}}>
sCLSID_SpMemoryStream	TEXTEQU	<{05FB7EF7Dh,0DFF4h,0468Ah,{0B6h,0B7h,02Fh,0CBh,0D1h,088h,0F9h,094h}}>

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.