Results 1 to 6 of 6

Thread: Translator with Sound/Speech

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Translator with Sound/Speech

    Here is a little word translation sample i would like people to have.. if you have any questions feel free to ask. you can also download the sounds/speech, ask me how if you need and i will show you how

    i only used textbox and mine does not display (chinese,arabic...) languages its shows up as ?????... if you need other languages i would recommend switch to other types of control that will support other languages such as "Microsoft Forms 2.0 Object Library" (or other controls)

    Speech translation will work however, even if it does not display correctly in textbox

    anyways here is a working translator with sound


    ***Additional*** Example of how to get speech/sound status
    Code:
    Private Sub Command1_Click()
    WindowsMediaPlayer1.URL = "http://translate.google.com/translate_tts?ie=UTF-8&tl=" & GetLanguage(cmbTo) & "&q=" & ieGoogle.document.getElementById("result_box").innertext
    ChangeStatus "Loading Speech/Audio...."
    Do Until WindowsMediaPlayer1.playState = wmppsPlaying
      DoEvents
    Loop
    ChangeStatus "Playing Speech/Audio..."
    Do Until WindowsMediaPlayer1.playState = wmppsStopped
      DoEvents
    Loop
    ChangeStatus "Ready"
    End Sub
    
    Private Sub Command2_Click()
    WindowsMediaPlayer1.URL = "http://translate.google.com/translate_tts?ie=UTF-8&tl=" & GetLanguage(cmbFrom) & "&q=" & txtTranslate.Text
    ChangeStatus "Loading Speech/Audio...."
    Do Until WindowsMediaPlayer1.playState = wmppsPlaying
      DoEvents
    Loop
    ChangeStatus "Playing Speech/Audio..."
    Do Until WindowsMediaPlayer1.playState = wmppsStopped
      DoEvents
    Loop
    ChangeStatus "Ready"
    End Sub
    
    Private Sub cmdTranslate_Click()
    On Error Resume Next
      Command1.Enabled = True
      Command2.Enabled = True
      txtResult.Enabled = True
      txtResult.Text = ieGoogle.document.getElementById("result_box").innertext
      
      ChangeStatus "Preparing Speech/Audio...."
      
      WindowsMediaPlayer1.URL = "http://translate.google.com/translate_tts?ie=UTF-8&tl=" & GetLanguage(cmbFrom) & "&q="
      
      Do Until WindowsMediaPlayer1.playState = wmppsReady
        DoEvents
      Loop
      ChangeStatus "Ready"
    End Sub
    ******FOR UNICODE SUPPORT******
    Download free unicode controls - EditControls
    Install
    Replace original txtResult with the new TimoSoft EditControls 1.8 (or earlier version)
    Make sure it is Multiline = True

    here you go with full language support and full sound support!!
    Attached Files Attached Files
    Last edited by Max187Boucher; Oct 12th, 2012 at 07:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width