⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 txt2snd.frm

📁 可用于日语文本的发音朗读
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "朗读日语的程序 (本程序由钟嵘设计)"
   ClientHeight    =   7485
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5235
   LinkTopic       =   "Form1"
   ScaleHeight     =   7485
   ScaleWidth      =   5235
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text2 
      Height          =   1575
      Left            =   240
      TabIndex        =   5
      Top             =   5520
      Width           =   4695
   End
   Begin VB.CommandButton Command4 
      Caption         =   "退出"
      Height          =   975
      Left            =   3840
      TabIndex        =   4
      Top             =   4440
      Width           =   1095
   End
   Begin VB.CommandButton Command3 
      Caption         =   "暂停"
      Height          =   975
      Left            =   2640
      TabIndex        =   3
      Top             =   4440
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "停止"
      Height          =   975
      Left            =   1440
      TabIndex        =   2
      Top             =   4440
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "朗读"
      Height          =   975
      Left            =   240
      TabIndex        =   1
      Top             =   4440
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   4095
      Left            =   240
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   0
      Text            =   "txt2snd.frx":0000
      Top             =   240
      Width           =   4695
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim z1 As Integer, Str1 As String
Private Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long

Private Sub Command1_Click()
  On Error GoTo handler
  Call VTxtAuto.VTxtAuto.Speak(Trim(Text1.Text), vtxtsp_VERYHIGH + vtxtst_READING)
  Command2.Enabled = True
  Command3.Enabled = True
  Exit Sub
handler:
  MsgBox "只能读英文文档", "错误提示"
End Sub

Private Sub Command2_Click()
  Call VTxtAuto.VTxtAuto.StopSpeaking
  Command2.Enabled = False
  Command3.Enabled = False
End Sub

Private Sub Command3_Click()
  If VTxtAuto.VTxtAuto.IsSpeaking Then
    Call VTxtAuto.VTxtAuto.AudioPause
    Command3.Caption = "恢复"
  Else
    Call VTxtAuto.AudioResume
    Command3.Caption = "暂停"
  End If
End Sub

Private Sub Command4_Click()
  Unload Me
End Sub

Private Sub Form_Load()
  Dim i As Integer
  i = waveOutGetNumDevs()
  If i <= 0 Then
    MsgBox "系统无声卡或未装声卡驱动程序"
    Unload Me
  Else
  
    Call VTxtAuto.VTxtAuto.Register(Space(10), Space(10))
  
  End If

End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = 32 Then
    Str1 = Right(Text2, Len(Text2) - z1 - 1)
    z1 = Len(Text2)
    On Error GoTo handler
    Call VTxtAuto.VTxtAuto.Speak(Trim(Str1), vtxtsp_VERYHIGH + vtxtst_READING)
    Exit Sub
handler:
  MsgBox "只能读英文文档", "错误提示"
  End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -