Difference between revisions of "Voice translation Qt"

From GCompris
Jump to: navigation, search
(Alphabet)
(Recording / Encoding)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Get the voices =
+
= Status =
  
== From the source code ==
+
You can get on [http://gcompris.net/voicestats this page] the status of what's missing for each locale.
First, grab the development tree and the voices in a separate top level directory, then make a link from boards/voices to this location. You can do it by following this process:
 
<pre>git clone https://github.com/bdoin/GCompris-voices.git</pre>
 
  
== Online ==
+
= Get the voices =
Alternatively, you can browse the voices online from the gnome git [https://github.com/bdoin/GCompris-voices online repository].
+
You can browse the voices online from git [https://github.com/gcompris/GCompris-data/tree/master/voices/ online repository] or clone it: <pre>git clone https://github.com/gcompris/GCompris-data.git</pre>
  
 
= Create your voices directory =
 
= Create your voices directory =
Line 21: Line 19:
 
It is best to choose somebody that speaks and articulate well your language (a teacher is a good candidate).
 
It is best to choose somebody that speaks and articulate well your language (a teacher is a good candidate).
  
* You can make the recording with [http://audacity.sourceforge.net/ audacity]. It is mandatory to use mono wav 16bit/44100Hz to get the best quality/size ratio and because this works for any sound card.
+
You can find a lot of practical advices in [https://librivox.org/pages/about-recording/ librivox] that can help improve the quality of the recording.
 +
 
 +
* You can make the recording with [http://audacity.sourceforge.net/ audacity]. It is mandatory to use mono wav 16bit/44100Hz to get the best quality/size ratio and because this works for any sound card (If you are using a Zoom H1, configure the DIP switches under it with 'LO CUT=ON', 'AUTO LEVEL=ON', 'REC FORMAT=WAV' and select WAV format 44/16 in the display panel).
 
* Save as WAV file
 
* Save as WAV file
 
* Apply loudness transform with sox if necessary. You may use a script like this if the sound is too low:
 
* Apply loudness transform with sox if necessary. You may use a script like this if the sound is too low:
Line 41: Line 41:
  
 
* Copy OGG files in the corresponding directory
 
* Copy OGG files in the corresponding directory
 +
 +
== Spliting a single recorded file ==
 +
 +
You can make a recording session in a single file and then split it with Audacity. First step is to change it from stereo to mono (menu Tracks -> Stereo to Mono). Then you can label each word or sentence by selecting it and using the "track->add label at selection" option (ctrl-b).
 +
 +
You can label as many words as the file contains. Try to be precise and avoid unnecessary blank at start and end of words. Once the labels are placed, use the 'File->export multiple" feature (ctrl-shift-l). Select ogg, keep the quality option to the default (5) (TBD, is this the best for voices?).
 +
 +
In the meta data dialog, put your name in Artist, album title is GCompris, put the Year and add a Copyright tag with the value GPL V3+. You can then click on 'set default' and no more worry about that. You can even in the global configuration in the export option disable the metadata dialog box entirely.
 +
 +
== Tagging ==
 +
 +
If you don't have the correct tag information in the ogg files, you can retag it with:
 +
 +
<pre>
 +
for f in *.ogg; do
 +
  vorbiscomment -w $f -t "ARTIST=<you name>" -t "TITTLE=GCompris" -t "COPYRIGHT=GPL V3+" -t "DATE=2015"
 +
done
 +
</pre>
 +
 +
== Normalizing ==
 +
 +
Volumes of files may mismatch. To normalize them:
 +
 +
<pre>
 +
for f in *.ogg; do
 +
  normalize-ogg $f
 +
done
 +
</pre>
 +
 +
== Stereo to Mono ==
 +
 +
If your ogg files are stereo, you can convert them in mono with:
 +
 +
<pre>
 +
for f in *.ogg do
 +
  oggdec $f
 +
  oggenc -o $f --downmix ${f%.*}.wav
 +
  vorbiscomment -w $f -t "ARTIST=<your name here>" -t "TITTLE=GCompris" -t "COPYRIGHT=GPL V3+" -t "DATE=2015"
 +
done
 +
</pre>
  
 
= Alphabet =
 
= Alphabet =
Line 50: Line 90:
 
= Lang word list =
 
= Lang word list =
  
The lang activity contains a set of about 1000 images originaly comming from the [http://www.art4apps.org/ art4apps project] and are released under CC-BY-SA. In order to make it available in your language, you must provide a voice recording of each words and an UTF-8 encoded file named content-<your_locale>.json that contains the translation of each word as spoken in the ogg file. The ogg files are in the voice directory <locale>/words and the json file in in the source code under /src/activities/imageid/resource/content-<your-locale>.json. If your language has genders it is mandatory to enter them in the recording and the content.txt file.
+
The lang activity contains a set of about 1000 images originaly comming from the [http://www.art4apps.org/ art4apps project] and are released under CC-BY-SA. In order to make it available in your language, you must provide a voice recording of each words and an UTF-8 encoded file named content-<your_locale>.json that contains the translation of each word as spoken in the ogg file. The ogg files are in the voice directory <locale>/words and the json file in in the source code under /src/activities/lang/resource/content-<your-locale>.json. If your language has genders it is mandatory to enter them in the recording and the ''content'' file.
  
 
You can see on a [http://gcompris.net/incoming/lang/words.html single page] the images and their english name.
 
You can see on a [http://gcompris.net/incoming/lang/words.html single page] the images and their english name.
Line 67: Line 107:
 
To create the rcc file, you script '''generate_voices_rcc.sh'''. It creates all the rcc files for all the langs in .rcc/voices-ogg. To test your creation, copy the files here under $HOME/.local/share/KDE/gcompris-qt/data2/voices-ogg and run GCompris with the download option disabled or the version of gcompris.net will take.
 
To create the rcc file, you script '''generate_voices_rcc.sh'''. It creates all the rcc files for all the langs in .rcc/voices-ogg. To test your creation, copy the files here under $HOME/.local/share/KDE/gcompris-qt/data2/voices-ogg and run GCompris with the download option disabled or the version of gcompris.net will take.
  
Once done, the generated rcc must be uploaded on gcompris.net by someone with the admin rights.
+
Once done, the generated rcc must be uploaded on gcompris.net by someone with the admin rights. On gcompris.net go in /opt/gcompris and run the script ./updateVoices.sh. It pulls the latest voice git, pack them in .rcc and install them under /var/www/data2 ready to be downloaded by GCompris.
 
 
= Checking =
 
 
 
At top level in the Gtk+ version of GCompris, run:
 
<code><pre>./tools/check_missing_voices.pl <locale>
 
</pre></code>
 
 
 
With for example locale being '''fr''' for French.
 
 
 
= Introduction Voice Set =
 
 
 
This voice set if present gives a brief explanation of the activity when the child enters it. Here is the English version that needs to be recorded in your language.
 
 
 
{|
 
! file !! voice
 
|-
 
|advanced_colors.ogg || find the dancing butterfly having the requested color
 
|-
 
|algebra_by.ogg || Multiply the two numbers together and type in your answer before the balloon landing
 
|-
 
|algebra_div.ogg || Find the result of the division and type in your answer before the balloon landing
 
|-
 
|algebra_minus.ogg || Subtract the two numbers and type in your answer before the balloon landing
 
|-
 
|algebra_plus.ogg || Add the two numbers together and type in your answer before the balloon landing
 
|-
 
|algorithm.ogg || Click on the missing items on the table and follow the logical sequence displayed above it.
 
|-
 
|align4-2players.ogg || Click on the column where you wish your token to fall and try to align 4 tokens to win.
 
|-
 
|align4.ogg || Click on the column where you wish your token to fall and try to align of 4 tokens before Tux.
 
|-
 
|alphabet-sequence.ogg || Move the helicopter to catch the clouds following the order of the alphabet.
 
|-
 
|ballcatch.ogg || Press the left and right arrow key at the same time to send the ball straight on
 
|-
 
|braille_alphabets.ogg || Click on Tux to start and then re-create the Braille cells.
 
|-
 
|braille_fun.ogg || Create the Braille cell for the falling letter.
 
|-
 
|canal_lock.ogg || You are responsible for the lock and you must help Tux pass through. Click on the valves to cause either a drop or an increase in the water level, and click on the gates to open or close a path.
 
|-
 
|clickanddraw.ogg || Click on the selected points and draw
 
|-
 
|clickgame.ogg || Catch the fish before they leave the aquarium.
 
|-
 
|click_on_letter.ogg || Click on the required letter. You can listen to it again by clicking on the mouth.
 
|-
 
|click_on_letter_up.ogg || Click on the required letter. You can listen to it again by clicking on the mouth.
 
|-
 
|clockgame.ogg || Use the mouse to drag and drop the needles of the clock and display the required time
 
|-
 
|color_mix.ogg || Match the colour by moving the sliders on the tubes of paint
 
|-
 
|color_mix_light.ogg || Match the colour by moving the sliders on the torches
 
|-
 
|colors.ogg || Click on the right color
 
|-
 
|drawnumber.ogg || Draw the picture by touching each number in the right sequence.
 
|-
 
|enumerate.ogg || Count the elements by organising them then type the answer on your keyboard.
 
|-
 
|erase_2clic.ogg || Double tap or double click on the bricks to discover the hidden picture
 
|-
 
|erase.ogg ||  Clear the window with your sponge and discover the hidden picture.
 
|-
 
|erase_clic.ogg ||  Click or tap on the transparent bricks and discover the hidden picture.
 
|-
 
|fifteen.ogg || Click or drag an element next to a free space, the element will move and release its space. You must put all the pieces in the correct order. The numbers on the pieces can help you.
 
|-
 
||followline.ogg ||  Move the mouse or your finger along the pipe to stop the fire.
 
|-
 
|football.ogg || Drag a line from the ball to set the speed and direction of your kick.
 
|-
 
|gletters.ogg || Type the letters on your keyboard before they reach the ground.
 
|-
 
|gnumch-equality.ogg || Guide the number eater to the required numbers and press on it to swallow them.
 
|-
 
|gnumch-factors.ogg || Guide the number eater to the required numbers and press on it to swallow them.
 
|-
 
|gnumch-inequality.ogg || Guide the number eater to the required numbers and press on it to swallow them.
 
|-
 
|gnumch-multiples.ogg || Guide the number eater to the required numbers and press on it to swallow them.
 
|-
 
|gnumch-primes.ogg || Guide the number eater with the arrow keys to the prime numbers and press space to swallow them.
 
|-
 
|guessnumber.ogg || Find out the number by typing a number from the range proposed.
 
|-
 
|hanoi.ogg || Rebuild the same tower in the empty area as the one you see on the right hand side.
 
|-
 
|hanoi_real.ogg || Rebuild the model tower on the right support. Take care, no disc may be placed atop a smaller disc.
 
|-
 
|hexagon.ogg || Click on the hexagons to find the hidden object, the red zone indicates that you're close to it!
 
|-
 
|imageid.ogg || Click on the word matching the picture.
 
|-
 
|instruments.ogg || Click on the correct musical instrument.
 
|-
 
|intro_gravity.ogg || Change the planets' gravitational force by moving the sliders up and down. Be careful not to crash Tux's spaceship.
 
|-
 
|leftright.ogg || Guess if the picture presents a left or right hand and click on the correct answer.
 
|-
 
|lightsoff.ogg || Click on the lamps to turn them off.
 
|-
 
|louis-braille.ogg || Discover the history behind Louis Braille.
 
|-
 
|magic-hat-minus.ogg || Click on the hat. How many stars are still hiding under the hat.
 
|-
 
|magic-hat-plus.ogg || Count the number of stars hidden under the hat and then click on the stars to indicate their number.
 
|-
 
|maze.ogg || Use the arrows keys or swipe the touch screen to help Tux find his way out.
 
|-
 
|mazeinvisible.ogg || Use the arrow keys or swipe the touch screen to guide Tux out. Use the maze icon or the space key to see the map.
 
|-
 
|mazerelative.ogg || Help Tux find his way out. Left and right are used to turn and up to go forward.
 
|-
 
|memory.ogg || Click on a card and find its double.
 
|-
 
|memory-enumerate.ogg || Match a number card with a card displaying the same number of butterflies.
 
|-
 
|memory-math-add.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-add-minus.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-add-minus-mult-div.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-add-minus-mult-div-tux.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-add-minus-tux.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-add-tux.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-div.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-div-tux.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-minus.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-minus-tux.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-mult.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-mult-div.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-mult-div-tux.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-math-mult-tux.ogg || Turn over two cards to match the calculation with its answer.
 
|-
 
|memory-sound.ogg || Click on an audio card and find its double.
 
|-
 
|memory-sound-tux.ogg || Take turns competing against Tux by clicking on a card and finding its double.
 
|-
 
|memory-tux.ogg || Take turns competing against Tux by clicking on a card and finding its double.
 
|-
 
|memory-wordnumber.ogg || Match the numeric with the word.
 
|-
 
|mining.ogg || Looking at the rockwall, you can see a sparkle somewhere. Move the mouse cursor next to this sparkle and use the mousewheel or the zoom gesture  to zoom in.
 
|-
 
|missing-letter.ogg || Find the missing letter and complete the word by clicking on one of the letters proposed on the side.
 
|-
 
|money.ogg || Click or tap on the money to pay.
 
|-
 
|money_back.ogg || Click on the money at the bottom of the screen to give Tux his change.
 
|-
 
|money_back_cents.ogg || Click on the money at the bottom of the screen to give Tux his change.
 
|-
 
|money_cents.ogg || Click on the money to pay.
 
|-
 
|mosaic.ogg || Put each item at the same place as in the given example.
 
|-
 
|numbers-odd-even.ogg || Move the helicopter to catch the clouds having even or odd numbers
 
|-
 
|penalty.ogg || Double click or double tap on the ball to score a goal.
 
|-
 
|planegame.ogg || Move the helicopter with the arrow keys and catch the number in the clouds in numerical order.
 
|-
 
|redraw.ogg || Use the drawing tools to reproduce a symmetrical figure on the right hand side.
 
|-
 
|redraw_symmetrical.ogg || Use the drawing tools to reproduce the right-hand side symmetrical figure.
 
|-
 
|reversecount.ogg || Click on the dice and validate your choice with the OK button to indicate the number of ice blocks Tux will have to follow to eat a fish.
 
|-
 
|scalesboard.ogg || Drag the weights up to balance the scales.
 
|-
 
|scalesboard_weight.ogg || Drag the weights up to balance the scales.
 
|-
 
|scalesboard_weight_avoirdupois.ogg || Drag the weights up to balance the scales.
 
|-
 
|simplepaint.ogg || Select a color and paint the rectangles as you like to create a drawing.
 
|-
 
|smallnumbers2.ogg || Count the number of the points on the dice then type the result on your keyboard.
 
|-
 
|smallnumbers.ogg || Count the number on your dice and type it on your keyboard before it reaches the ground.
 
|-
 
|sudoku.ogg || Select a number or a symbol and click its target area. Each symbol must appear only once in a row, in a column and in a subregion if any.
 
|-
 
|superbrain.ogg || Find out the right combination of colors. A black pin means you found the correct colour in the correct position, a white pin means it's the correct colour but in the wrong position.
 
|-
 
|target.ogg || Click on the target to launch darts, then count your score!
 
|-
 
|template.ogg || put here in comment the text for the intro voice
 
|-
 
|tic_tac_toe_2players.ogg || Click on the square which you wish to mark and try to mark 3 consecutive squares before Tux.
 
|-
 
|tic_tac_toe.ogg || Click on the square which you wish to mark and try to mark 3 consecutive squares before Tux.
 
|-
 
|traffic.ogg || Slide the cars to make a space so that the red car can go out of the box.
 
|-
 
|wordsgame.ogg || Type the words on your keyboard before they reach the ground.
 
|}
 
  
 
[[Category:Translation]]
 
[[Category:Translation]]
 
[[Category:English]]
 
[[Category:English]]

Latest revision as of 22:12, 15 December 2020

Status

You can get on this page the status of what's missing for each locale.

Get the voices

You can browse the voices online from git online repository or clone it:

git clone https://github.com/gcompris/GCompris-data.git

Create your voices directory

First copy the English voices as a template in a new directory with you locale name (e.g. my):

cd boards/voices
cp -r en my

Provide your voice translation in boards/voices/my for each English voice.

Recording / Encoding

It is best to choose somebody that speaks and articulate well your language (a teacher is a good candidate).

You can find a lot of practical advices in librivox that can help improve the quality of the recording.

  • You can make the recording with audacity. It is mandatory to use mono wav 16bit/44100Hz to get the best quality/size ratio and because this works for any sound card (If you are using a Zoom H1, configure the DIP switches under it with 'LO CUT=ON', 'AUTO LEVEL=ON', 'REC FORMAT=WAV' and select WAV format 44/16 in the display panel).
  • Save as WAV file
  • Apply loudness transform with sox if necessary. You may use a script like this if the sound is too low:
#!/bin/sh
mkdir modif
for i in *.wav; do
  sox $i -r 44100 -b 16 modif/$i norm
done
  • In the directory where WAV files are run:
oggenc -q0 --downmix -a "(name of author) -d "date of recording (YYYY/MM/DD)" -c "copyright=GPL V3+" *.wav

The ogginfo command should display the comment.

The last stage is to pass the tool normalize-ogg to make all the sound having a standardized volume level.

  • Copy OGG files in the corresponding directory

Spliting a single recorded file

You can make a recording session in a single file and then split it with Audacity. First step is to change it from stereo to mono (menu Tracks -> Stereo to Mono). Then you can label each word or sentence by selecting it and using the "track->add label at selection" option (ctrl-b).

You can label as many words as the file contains. Try to be precise and avoid unnecessary blank at start and end of words. Once the labels are placed, use the 'File->export multiple" feature (ctrl-shift-l). Select ogg, keep the quality option to the default (5) (TBD, is this the best for voices?).

In the meta data dialog, put your name in Artist, album title is GCompris, put the Year and add a Copyright tag with the value GPL V3+. You can then click on 'set default' and no more worry about that. You can even in the global configuration in the export option disable the metadata dialog box entirely.

Tagging

If you don't have the correct tag information in the ogg files, you can retag it with:

for f in *.ogg; do
  vorbiscomment -w $f -t "ARTIST=<you name>" -t "TITTLE=GCompris" -t "COPYRIGHT=GPL V3+" -t "DATE=2015"
done

Normalizing

Volumes of files may mismatch. To normalize them:

for f in *.ogg; do
  normalize-ogg $f
done

Stereo to Mono

If your ogg files are stereo, you can convert them in mono with:

for f in *.ogg do
  oggdec $f 
  oggenc -o $f --downmix ${f%.*}.wav
  vorbiscomment -w $f -t "ARTIST=<your name here>" -t "TITTLE=GCompris" -t "COPYRIGHT=GPL V3+" -t "DATE=2015"
done

Alphabet

The English alphabet directory contains files named U0030.ogg. These are the voices for each single letter in your locale with a UTF-8 Unicode notation. For example, U+0030 is the character 0, and U+0069 is the character i. You can get the table for each subset.

Warning: We only need the lower case version of each letter. For example, we have U+0061 (letter 'a') but we don't need U+0041 (letter 'A'). Same for accentuated letter.

Lang word list

The lang activity contains a set of about 1000 images originaly comming from the art4apps project and are released under CC-BY-SA. In order to make it available in your language, you must provide a voice recording of each words and an UTF-8 encoded file named content-<your_locale>.json that contains the translation of each word as spoken in the ogg file. The ogg files are in the voice directory <locale>/words and the json file in in the source code under /src/activities/lang/resource/content-<your-locale>.json. If your language has genders it is mandatory to enter them in the recording and the content file.

You can see on a single page the images and their english name.

Shipping

Once done, the easiest way is to tar all this files and send them to the GCompris maintainer.

tar -cvzf voices_my.tgz my

Integration

The voice are packaged in an rcc file. It can be tested by following this instructions.

To create the rcc file, you script generate_voices_rcc.sh. It creates all the rcc files for all the langs in .rcc/voices-ogg. To test your creation, copy the files here under $HOME/.local/share/KDE/gcompris-qt/data2/voices-ogg and run GCompris with the download option disabled or the version of gcompris.net will take.

Once done, the generated rcc must be uploaded on gcompris.net by someone with the admin rights. On gcompris.net go in /opt/gcompris and run the script ./updateVoices.sh. It pulls the latest voice git, pack them in .rcc and install them under /var/www/data2 ready to be downloaded by GCompris.