Private Function DossierProjet() As Stringqui renvoie, calculé d'après le programme, le chemin d'accès du projet. Je mets alors dans ce pseudo-dossier tout fichier qu'il me plaira. Je sais que c'est parfaitement iconoclaste (j'aime ça), mais cela ne vous coûterais rien d'essayer.
Dim Dos As String
Dos = Application.StartupPath : Dos = GetDirectoryName(Dos) : Dos = GetDirectoryName(Dos)
Return Dos
End Function
Imports System.Speech
Imports System.Speech.Synthesis
synth = New SpeechSynthesizer
synth.SelectVoice("ScanSoft Virginie_Dri40_16kHz")
synth.Rate = 0
Option Strict On
Imports System.Speech
Imports System.Speech.Synthesis
Public Class Form1
Dim s As SpeechSynthesizer = New SpeechSynthesizer() ' declaration du systeme de narration
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'au chargementde la forme:
Dim i As Integer
Dim listString As String
Dim reponse As String
Dim listevoix = s.GetInstalledVoices 'listevoix est egale a la liste des voix installer
reponse = "Virginie"
For Each v As InstalledVoice In listevoix 'je charge chaque voix installer et les affiche
ListBox1.Items.Add(v.VoiceInfo.Name) '
Next
'je cherche si Virginie est installée
For i = 0 To ListBox1.Items.Count - 1
listString = CStr(ListBox1.Items.Item(i))
If CBool(InStr(listString.ToLower, reponse.ToLower)) Then
ListBox1.SelectedItems.Add(listString)
End If
Next
' MessageBox.Show("Recherche terminée.", "Recherche", MessageBoxButtons.OK, MessageBoxIcon.Information)
listString = Nothing
If ListBox1.SelectedIndex <= 0 Then
Process.Start(Application.StartupPath & "\RSSolo4FrenchVirginie.exe") 'lancement de l'installation
Else
'rien
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' quand je clics sur le bouton1
Dim texte As String = "Il est " & Now.Hour & " heure et " & Now.Minute & "Minute" 'declaration du texte
Dim voix As String = CStr(ListBox1.SelectedItem) 'la voixest egale la selection du combobox
s.SelectVoice(voix) ' je choisi la voix
s.Speak(texte) 'je lis le texte
End Sub
'emplacement de RSSolo4FrenchVirginie
'HKEY_LOCAL_MACHINE\SOFTWARE\ScanSoft\TTS\SAPI5
'C:\Program Files (x86)\ScanSoft\RealSpeakSolov4
End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question