Morse Code Converter


Service “Morse Code Converter” allows you to convert electronic text into Morse code and vice versa. As input for the service there should be provided electronic text or Morse code of symbolic kind, and after the conversion, a user receives Morse code (in symbolic or sound form), or electronic text online.

 

Basic terms and concepts

Morse alphabet — is the signaling sequence of text (e.g., flashes of light, a mixture of dots and dashes, clicks, etc.) that can be easily recognized by a special receiver of related information. Morse has been named in honor of Samuel Morse, one of the founders of the telegraph and symbolic alphabet.

 

Practical value

In addition to its main task — converting the Morse Code to text and vice versa — the service can be used to study Morse code.

Service is in the public domain, it can be used by a wide range of users in different directions without any restrictions.

 

Service features

Translations of text in Morse code could be implemented in one of three languages:

  • Belarusian
  • Russian
  • English

 

External service interface

The external service interface is shown in Figure 1.

Малюнак 1. Знешні інтэрфейс сэрвісу «Канвертар азбукі Морзэ»

Figure 1. External service interface “Morse Code Converter”

 

The interface contains the following areas:

  • electronic text input field;
  • type of final data menu:
    • Morse code;
    • electronic text on the symbols of the Belarusian language (Беларуская);
    • electronic text on the symbols of the Russian language (Русский);
    • эelectronic text on the symbols of the English language ;
  • speed of resulting signal of Morse code menu:
    • Slow;
    • Medium;
    • High;
  • option “Show intermediate information”;
  • button “Convert!”, which starts conversion.

 

Cases of work with the service

Case 1: Convert the electronic text in Morse code

  1. Enter text in the input field that requires conversion into Morse code.
  2. In the menu, choose the type of final data “Morse code”.
  3. Select the desired speed in the speed selection menu.
  4. Press the “Convert!” to start the conversion and get the results (Figure 2).
  5. Play and | or download received audio file with the audio signal Morse code.
Малюнак 2. Вынікі канвертавання электроннага тэксту ў код Морзэ

Figure 2. Results of the conversion of electronic text in Morse code

 

Scenario 2: Convert Morse code to the electronic text

  1. Enter Morse in the input field code in the character form (for example, *– *- *** *– ** – *- * -*- *- -* *– * *-* – *- *-* -*- — -** **- — — *-* –** **-** –**– ).
  2. In the menu, choose the type of language characters in which the conversion should be done.
  3. Put sing “Show intermediate information”
  4. Press the “Convert!” to start the conversion and get the results (Figure 3).
  5. View and / or copy the text.
  6. Press the “Voice” to hear the final text, the spoken voice synthesizer. You can listen to the audio file and / or downloaded by clicking «download» (Figure 4).
  7. Press the “Calibrate” to check the correctness of the translation. If the service is working correctly, the user will see the message “calibrated” if there is no — “not calibrated” (Figures 5, 6). If it is impossible to convert one or another character in Morse code the user will receive a message with this symbol code (Figure 7).
Малюнак 3. Вынікі канвертавання коду Морзэ ў электронны тэкст

Figure 3. Results of converting the Morse Code into electronic text

Малюнак 4. Агучаны канвертаваны тэкст

Figure 4. Sounding converted text

Малюнак 5. Прыклад карэктнай каліброўкі выніковага тэксту

Figure 5: Example of correct calibration of the final text

Малюнак 6. Прыклад некарэктнай каліброўкі выніковага тэксту

Figure 6. Example of an incorrect calibration of the final text

Малюнак 7. Прыклад немагчымага канвертавання сімвала

Figure 7. Example of impossible for conversion symbol

 

Access to the service via the API

To access the service «Morse Code Converter» via the API, you should send an AJAX-request (type: POST) to the address https://corpus.by/MorseCodeConverter/api.php. With an input array data the following parameters are passed:

  • text — arbitrary input text.
  • language — language in which the input text should be converted. Following options are available:
    • be — convert Morse code to text in Belarusian;
    • en — convert Morse code to text in English;
    • ru — convert Morse code to text in Russian;
    • mor — convert text in Belarusian, English or Russian languages or in Morse code.
  • speed — parameter defining the Morse code speed when generating a sound file. Following options are available:
    • slow — slow speed;
    • medium — normal speed;
    • high — high speed.
  • loga — marker for getting additional information.

Examle of AJAX-request:

$.ajax({
   type: “POST”,
   url: “https://corpus.by/MorseCodeConverter/api.php”,
   data:{
      “text”: “Вас вітае канвертар коду Морзэ!”,
      “language”: “mor”,
      “speed”: “medium”,
      “loga”: 0
   },
   success: function(msg){ },
   error: function() { }
});

The server returns a JSON-array with the following parameters:

  • text — input text.
  • result — fragment of html-pages with the final sound file and text.

For example, the following reply will be formed on the above listed AJAX-request:

[
   {
      “text”: “Вас вітае канвертар коду Морзэ!”,
      “result”: “<h2 class=”sub-caption-smaller”>Праслухаць сінтэзаванае маўленне</h2><p><audio controls=””><source src=”../_cache/MorseCodeConverter/out/2018-06-22_17-21-51_80-94-162-88_312_out.wav” type=”audio/wav”>Your browser does not support the audio element.</audio></p><p>альбо <a type=”audio/wav” href=”https://corpus.by/_cache/MorseCodeConverter/out/2018-06-22_17-21-51_80-94-162-88_312_out.wav” download=””>спампаваць файл з сінтэзаваным маўленнем</a></p><p></p><textarea id=”outputId” name=”output” class=”main-textarea” readonly=””>*– *- *** *– ** – *- * -*- *- -* *– * *-* – *- *-* -*- — -** **- — — *-* –** **-** –**– </textarea>”
   }
]

 

Links to sources

Service page “Morse Code Converter”: https://corpus.by/MorseCodeConverter/?lang=be

If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.