Visual Basic, .NET, ASP, VBScript
 

   
   
     

Форум - VBA

Страница: 1 |

 

  Вопрос: помогите найти код программы Говорящие часы Добавлено: 09.06.06 19:48  

Автор вопроса:  Oksana
Очень-очень нужен код на Visual Basic "говорящие часы"

Ответить

  Ответы Всего ответов: 2  

Номер ответа: 1
Автор ответа:
 Neco



ICQ: 247906854 

Вопросов: 133
Ответов: 882
 Web-сайт: neco.pisem.net
 Профиль | | #1
Добавлено: 09.06.06 22:12
качаешь SpeechAPI, кидаешь его компонент в проект, скармливаешь ему текст - он произносит.

Ответить

Номер ответа: 2
Автор ответа:
 Серёга



ICQ: 262809473 

Вопросов: 17
Ответов: 561
 Web-сайт: houselab.narod.ru
 Профиль | | #2
Добавлено: 18.06.06 20:45
Можешь использовать API.
Вот тебе набросок кода:
________________________
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Private Sub SayHowLong(H As Integer, M As Integer)
Dim TTT As Integer
sndPlaySound App.Path + "\sound\prod.wav", 0
If H <> 0 Then
  If H = 1 Or H = 21 Then
    If H = 1 Then sndPlaySound App.Path + "\sound\1.wav", 0
    If H = 21 Then
      sndPlaySound App.Path + "\sound\20.wav", 0
      sndPlaySound App.Path + "\sound\1.wav", 0
    End If
    sndPlaySound App.Path + "\sound\chas.wav", 0
  End If
  If H = 2 Or H = 3 Or H = 4 Or H = 22 Or H = 23 Then
    If H = 2 Then sndPlaySound App.Path + "\sound\2.wav", 0
    If H = 3 Then sndPlaySound App.Path + "\sound\3.wav", 0
    If H = 4 Then sndPlaySound App.Path + "\sound\4.wav", 0
    If H = 22 Then
      sndPlaySound App.Path + "\sound\20.wav", 0
      sndPlaySound App.Path + "\sound\2.wav", 0
    End If
    If H = 23 Then
      sndPlaySound App.Path + "\sound\20.wav", 0
      sndPlaySound App.Path + "\sound\3.wav", 0
    End If
    sndPlaySound App.Path + "\sound\chasa.wav", 0
  End If
  If H > 4 And H < 21 Then
    If H = 5 Then sndPlaySound App.Path + "\sound\5.wav", 0
    If H = 6 Then sndPlaySound App.Path + "\sound\6.wav", 0
    If H = 7 Then sndPlaySound App.Path + "\sound\7.wav", 0
    If H = 8 Then sndPlaySound App.Path + "\sound\8.wav", 0
    If H = 9 Then sndPlaySound App.Path + "\sound\9.wav", 0
    If H = 10 Then sndPlaySound App.Path + "\sound\10.wav", 0
    If H = 11 Then sndPlaySound App.Path + "\sound\11.wav", 0
    If H = 12 Then sndPlaySound App.Path + "\sound\12.wav", 0
    If H = 13 Then sndPlaySound App.Path + "\sound\13.wav", 0
    If H = 14 Then sndPlaySound App.Path + "\sound\14.wav", 0
    If H = 15 Then sndPlaySound App.Path + "\sound\15.wav", 0
    If H = 16 Then sndPlaySound App.Path + "\sound\16.wav", 0
    If H = 17 Then sndPlaySound App.Path + "\sound\17.wav", 0
    If H = 18 Then sndPlaySound App.Path + "\sound\18.wav", 0
    If H = 19 Then sndPlaySound App.Path + "\sound\19.wav", 0
    If H = 20 Then sndPlaySound App.Path + "\sound\20.wav", 0
    sndPlaySound App.Path + "\sound\chasov.wav", 0
  End If
End If

If M <> 0 Then
  If M = 1 Then
    If M = 1 Then sndPlaySound App.Path + "\sound\odna.wav", 0
    sndPlaySound App.Path + "\sound\minuta.wav", 0
  End If
  If M > 1 And M < 5 Then
    If M = 2 Then sndPlaySound App.Path + "\sound\dve.wav", 0
    If M = 3 Then sndPlaySound App.Path + "\sound\3.wav", 0
    If M = 4 Then sndPlaySound App.Path + "\sound\4.wav", 0
    sndPlaySound App.Path + "\sound\minuty.wav", 0
  End If
  If M > 20 Then TTT = CInt(Mid(CStr(M), 2, 1)) Else TTT = -1
  If M > 4 And M < 21 Then
    If M = 5 Then sndPlaySound App.Path + "\sound\5.wav", 0
    If M = 6 Then sndPlaySound App.Path + "\sound\6.wav", 0
    If M = 7 Then sndPlaySound App.Path + "\sound\7.wav", 0
    If M = 8 Then sndPlaySound App.Path + "\sound\8.wav", 0
    If M = 9 Then sndPlaySound App.Path + "\sound\9.wav", 0
    If M = 10 Then sndPlaySound App.Path + "\sound\10.wav", 0
    If M = 11 Then sndPlaySound App.Path + "\sound\11.wav", 0
    If M = 12 Then sndPlaySound App.Path + "\sound\12.wav", 0
    If M = 13 Then sndPlaySound App.Path + "\sound\13.wav", 0
    If M = 14 Then sndPlaySound App.Path + "\sound\14.wav", 0
    If M = 15 Then sndPlaySound App.Path + "\sound\15.wav", 0
    If M = 16 Then sndPlaySound App.Path + "\sound\16.wav", 0
    If M = 17 Then sndPlaySound App.Path + "\sound\17.wav", 0
    If M = 18 Then sndPlaySound App.Path + "\sound\18.wav", 0
    If M = 19 Then sndPlaySound App.Path + "\sound\19.wav", 0
    If M = 20 Then sndPlaySound App.Path + "\sound\20.wav", 0
    sndPlaySound App.Path + "\sound\minut.wav", 0
  End If
  If TTT <> -1 Then
    If Int(M / 10) = 2 Then sndPlaySound App.Path + "\sound\20.wav", 0
    If Int(M / 10) = 3 Then sndPlaySound App.Path + "\sound\30.wav", 0
    If Int(M / 10) = 4 Then sndPlaySound App.Path + "\sound\40.wav", 0
    If Int(M / 10) = 5 Then sndPlaySound App.Path + "\sound\50.wav", 0
    
    If TTT = 1 Then sndPlaySound App.Path + "\sound\odna.wav", 0
    If TTT = 2 Then sndPlaySound App.Path + "\sound\dve.wav", 0
    If TTT = 3 Then sndPlaySound App.Path + "\sound\3.wav", 0
    If TTT = 4 Then sndPlaySound App.Path + "\sound\4.wav", 0
    If TTT = 5 Then sndPlaySound App.Path + "\sound\5.wav", 0
    If TTT = 6 Then sndPlaySound App.Path + "\sound\6.wav", 0
    If TTT = 7 Then sndPlaySound App.Path + "\sound\7.wav", 0
    If TTT = 8 Then sndPlaySound App.Path + "\sound\8.wav", 0
    If TTT = 9 Then sndPlaySound App.Path + "\sound\9.wav", 0
    
    If TTT = 1 Then sndPlaySound App.Path + "\sound\minuta.wav", 0
    If (TTT > 1) And (TTT < 5) Then sndPlaySound App.Path + "\sound\minuty.wav", 0
    If TTT > 4 Then sndPlaySound App.Path + "\sound\minut.wav", 0
    
  End If
End If

End Sub
___________________________

Вызываешь процедуру SayHowLong(часы,минуты)
и она говорит тебе время.

О файлах:
Почти всё можно понять по имени файла. Т.е.: в файле odna.wav должно быть слово "одна", minuty.wav-"минуты" и т.д. В файле prod.wav- вступление (типа: "Московское время";):)

Тебе остается только взять микрофон и наговорить эти файлы или можещь использовать ресурсы от проги InetTimer (http://all4u.nm.ru/itsetup.zip)

Удачи!

Ответить

Страница: 1 |

Поиск по форуму



© Copyright 2002-2011 VBNet.RU | Пишите нам