小弟用VB编写学生成绩统计程序,在学生成绩登录时,想通过小键盘输入出数字是喇叭能念出相应的数字,以帮助提示例如:某班有学生成绩表如下:学生1 98
                       学生2 98
                       学生3 98
                       学生4 98
                       ......  
在登录学生1成绩是,通过小键盘输入98,喇叭发声输入的数字是98,回车后输入下一个学生的成绩
数字1,2,3....9,0的wav文件我已有了
可是如何让他们发声呢?
高分求教

解决方案 »

  1.   

    还要录单位声.CALL sndPlaySound("D:\9.WAV",SND_SYNC)
    CALL sndPlaySound("D:\十.WAV",SND_SYNC)
    CALL sndPlaySound("D:\8.WAV",SND_SYNC)
      

  2.   

    已经解决了
    应用VB 的API 函数 Option Explicit '声明函数
    Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwflags As Long) As Long
    Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 48 Then PlaySound App.Path + "\sound\0.wav", 0&, &H1
    If KeyAscii = 49 Then PlaySound App.Path + "\sound\1.wav", 0&, &H1
    If KeyAscii = 50 Then PlaySound App.Path + "\sound\2.wav", 0&, &H1
    If KeyAscii = 51 Then PlaySound App.Path + "\sound\3.wav", 0&, &H1
    If KeyAscii = 52 Then PlaySound App.Path + "\sound\4.wav", 0&, &H1
    If KeyAscii = 53 Then PlaySound App.Path + "\sound\5.wav", 0&, &H1
    If KeyAscii = 54 Then PlaySound App.Path + "\sound\6.wav", 0&, &H1
    If KeyAscii = 55 Then PlaySound App.Path + "\sound\7.wav", 0&, &H1
    If KeyAscii = 56 Then PlaySound App.Path + "\sound\8.wav", 0&, &H1
    If KeyAscii = 57 Then PlaySound App.Path + "\sound\9.wav", 0&, &H1
    If KeyAscii = 46 Then PlaySound App.Path + "\sound\d.wav", 0&, &H1end sub与大家共享@@@@@