红袍老师,如果有未读消息时,每隔60秒播放一次语音提示,代码该怎么写。谢谢!语音代码:Dim sp As New DotNetSpeech.SpVoice()
sp.Speak("您有新的消息,请及时查看处理.", DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync) Then
If CurrentTable Is Nothing Then
Return
End If
'此段代码用于显示OpenQQ的未读消息
Static OpenQQ As RibbonMenu.Button
Static LastTime As Date
If OpenQQ Is Nothing Then
OpenQQ = ConfigBar.Items("OpenQQ")
End If
Dim txt As String
If QQClient.Ready
If QQClient.UnreadCount > 0 Then
txt = "(" & QQClient.UnreadCount & "条)"
End If
End If
If OpenQQ.Text <> txt Then
OpenQQ.Text = txt
End If
If OpenQQ.Text > "" Then
Dim ntp As timeSpan = Date.Now - LastTime
If ntp.TotalSeconds >= 0.5 Then
LastTime = Date.Now
If OpenQQ.ForeColor = Color.Red Then
OpenQQ.ForeColor = Color.Transparent
Else
OpenQQ.ForeColor = Color.Red
End If
End If
End If