locked
Sound.PlayAndWait(filePath) doesn't play audio-files RRS feed

  • Question

  • Hello. I am trying to make a small dictionary for one indigenous language and use text to speech synthesizer to produce wav audio files that represent words' pronunciation. A program compiled in Small Basic does not play those audio files. Is there a way to fix it?

    GraphicsWindow.Title = "Translator with pronunciation"
    Controls.ButtonClicked = p_knopka1
    knopka1 = Controls.AddButton("Translate and pronounce",25,25)
    tekst = Controls.AddTextBox(75,75)
    tekst2 = Controls.AddTextBox(275,75)
    Sub p_knopka1
      ps_knopka = Controls.LastClickedButton
      If ps_knopka = knopka1 Then
        n_str = n_str + 1
        stroka = File.ReadLine("1.txt", n_str)
        stroka2 = File.ReadLine("2.txt", n_str)
        Controls.SetTextBoxText(tekst,stroka)
        Controls.SetTextBoxText(tekst2,stroka2)
        n_fajla = stroka + ".wav"
        Controls.SetButtonCaption(knopka1,n_fajla)
        Sound.PlayAndWait(n_fajla)
        EndIf
    EndSub

    Wednesday, May 13, 2020 4:07 PM

Answers

  • it depends on ur file 1.txt wht it contains.

    u must reference every file with full path: e.g. "c:\sounds\1.wav"

    • Marked as answer by NickKozlov Wednesday, May 13, 2020 4:51 PM
    Wednesday, May 13, 2020 4:27 PM

All replies

  • it depends on ur file 1.txt wht it contains.

    u must reference every file with full path: e.g. "c:\sounds\1.wav"

    • Marked as answer by NickKozlov Wednesday, May 13, 2020 4:51 PM
    Wednesday, May 13, 2020 4:27 PM
  • Thank you. Now it works.
    Wednesday, May 13, 2020 4:51 PM