Recent

Author Topic: To link each sound to the translation and transcription  (Read 13362 times)

Neprofi

  • Full Member
  • ***
  • Posts: 174
To link each sound to the translation and transcription
« on: June 06, 2015, 05:36:08 pm »
how to bind to the sound of the text??? for every sound a particular example text goes here like this:
Instead of the sound which is output need a translation.

people be indifferent please help((( I would be grateful!
« Last Edit: June 09, 2015, 09:32:25 pm by Neprofi »

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: To link each sound to the translation and transcription
« Reply #1 on: June 06, 2015, 05:48:56 pm »
skalogryz has given you an example:

Quote
[about]
file=sound\about.mp3
eng=about
rus=о/об
trans=[əˈbɐʊt]

[across]
file=sound\across.mp3
eng=across
rus=через
trans=[əˈkɹɒs]

[koko]
file=sound\koko.mp3
eng=koko
rus=ко-ко
trans=[əˈkɹɒs]
« Last Edit: June 06, 2015, 05:51:29 pm by typo »

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: To link each sound to the translation and transcription
« Reply #2 on: June 06, 2015, 07:05:01 pm »
I gave the example only from the ini file, no mp3, but I need mp3, plays a sound and immediately give its translation in the Listbox.

please help.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: To link each sound to the translation and transcription
« Reply #3 on: June 06, 2015, 07:54:21 pm »
Take another look:

The INI file has the file name and with it you can open the corresponding audio file.

You can choose an audio library or use the OS default media player. You can use OpenDocument to play the file.
« Last Edit: June 06, 2015, 08:09:21 pm by typo »

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: To link each sound to the translation and transcription
« Reply #4 on: June 06, 2015, 08:57:23 pm »
Well I'll see, but still would like a ready code to look at, and then for 2 months can't cope with it(((( if anyone have time, take the time to explain to me what and what to do)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: To link each sound to the translation and transcription
« Reply #5 on: June 06, 2015, 09:09:36 pm »
Download this example:

http://sourceforge.net/projects/lazarusfiles/files/example.zip/download

Click on the word "about" in the listbox and see by yourself.

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: To link each sound to the translation and transcription
« Reply #6 on: June 06, 2015, 09:33:06 pm »
not working, gives an error.
unit1.pas(71,5) Error: Identifier not found "OpenDocument"

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: To link each sound to the translation and transcription
« Reply #7 on: June 06, 2015, 09:37:51 pm »
Add LCLIntf to your uses clause.

Hahaha, you are joking, I have already made this.
« Last Edit: June 06, 2015, 09:43:32 pm by typo »

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: To link each sound to the translation and transcription
« Reply #8 on: June 06, 2015, 09:44:21 pm »
Happened) thank you! so what: I press the forward button plays the sound, and once the translation is displayed in a Listbox, it can be done???
 :o

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: To link each sound to the translation and transcription
« Reply #9 on: June 06, 2015, 10:02:10 pm »
The media player will run when you click on the "about" word. No other action is required.

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: To link each sound to the translation and transcription
« Reply #10 on: June 06, 2015, 10:08:56 pm »
I use the Bass library to play sounds instead of Media player, explain the principle of operation for two or three songs please!!

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: To link each sound to the translation and transcription
« Reply #11 on: June 06, 2015, 10:12:53 pm »
All you need to do is to edit your INI file:

Quote
[about]
file=kalimba.mp3     <<<<<<<<<<<<<<<
eng=about
rus=о/об
trans=[əˈbɐʊt]

[across]
file=sound\across.mp3
eng=across
rus=через
trans=[əˈkɹɒs]

[koko]
file=sound\koko.mp3
eng=koko
rus=ко-ко
trans=[əˈkɹɒs]

And repeat the same principle to every other mp3 file.

Take a look at ListBox1SelectionChange event handler in the example.
« Last Edit: June 06, 2015, 10:15:32 pm by typo »

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: To link each sound to the translation and transcription
« Reply #12 on: June 06, 2015, 10:18:45 pm »
it is clear and be sure to click on the word from the list? I just created a list of the songs I use stringlist. they are not visible. I have pressing forward that would sound sounded and it was a translation, and the translation of sound! hope properly explained, thanks for the feedback.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: To link each sound to the translation and transcription
« Reply #13 on: June 06, 2015, 10:23:53 pm »
How many "songs" do you have?

Instead of having a list of sounds, you need to nominate each section of the INI file with one of them.

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: To link each sound to the translation and transcription
« Reply #14 on: June 06, 2015, 10:27:01 pm »
here is the list:

Flist:=TStringLIST.Create;   //announced the list
FList.Add('sound\.mp3');
FList.Add('sound\.mp3');
FList.Add('sound\.mp3');
FList.Add('sound\.mp3');
ListToListbox();
end;   




I have a lot of them show a couple of pieces
« Last Edit: June 09, 2015, 09:33:02 pm by Neprofi »

 

TinyPortal © 2005-2018