Morse Code Audio To Text API - MorseSonat (or Morse Code Sound To Text API) is a cross browsers REST API supporting now also Text To Morse Audio API (as normal text) or Morse Text To Morse Audio API and it may be used by any device that can connect to Internet and send the POST requests to our API as instructed in this website: smartphones, tablets, laptops, PC Desktops, other smart devices. It uses cloud infrastructure and artificial intelligence to solve the requests. With MorseSonat you can:
Allthough this Morse Code Audio To Text API is intended for software development and therefore developers, we have also here an online application that may be used to get audio files from the input text either plain text or morse code text with characters here. Morse Code Audio To Text API - The necessary steps are written below, basically for Morse Code Audio To Text API you send an authorized POST request in JSON format to the API endpoint and you get as JSON response a a link to the saved audio file if you chose so or decoded text. The output audio file encoded as Linear16 (uncompressed .wav file), PCM, 44100 HZ, 32 BitsPerSample, IeeeFloat Encoding, BlockAlign 8, Stereo 2 Channels has to be clear (without noises) and it is saved on cloud at the link you get as response from our text to morse code audio API.
You own the commercial copyright of the resulted audio file(s) with no additional fee. Morse Code Audio To Text APP or API is useful for a large number of domains like: communications, bots, smart devices, robots, messaging, call centers, enthuziasts etc.
For using our Morse Code Audio To Text API and/or APP you must create an account (free of charge, no card required), activate it from your received email, login and then start your TRIAL package with no fees as you can see at our pricing packages. After you have tested the Morse Code Audio To Text API and/or APP and you are satisfied, you may buy a paid package. You will always see at your Admin Console page the real resources consumption in real time, your invoices, you may see/edit/delete your profile or export log consents as GDPR instructed, you may read our FAQs.
Request Type: Normal Text To Morse Audio and Morse Text Morse Text To Morse Audio and Normal Text Morse Audio To Normal and Morse Text
hello world
https://gatiosoft.ro/morsesonat.aspx
Authorization: Basic //Your username:password are base64 encoded string Content-Type: application/json Accept: application/json
{ "morse_wav_file":"JHGGGGGGGH...base64 encoded...GHJBJHBGFVF", "normal_text":"NO", "morse_text":"NO" }
{ "normal_text":"hello world", "morse_text":"..././.-../.-../---/|.--/---/.-./.-../-..", "audioFileURL":"Not saved remotely" }
{ "cd":1001, "error":"The authorization header is either empty or isn't Basic." }
This is the error code which may be:
This is the description of the error code which may be:
The rules of International Morse Code are as foillows: a dit is one unit, a dash is three units, the space between parts of the same letter is is one unit, the space between letters is three units and the space between words is seven units. Regarding Morse text input, for an easy processing we put and require using "/" between letters of the same word and we put and require using of "|" between words.
Imports System.IO Imports System.Net Imports System.Web.Script.Serialization Public Class morse_code_audio_to_text_api Inherits System.Web.UI.Page Public Structure RequestFields Dim morse_wav_file As String Dim normal_text As String Dim morse_text As String End Structure Public Structure ResponseField Dim normal_text As String Dim morse_text As String Dim audioFileURL As String End Structure Public Structure ErrorFields Dim cd As String Dim description As String End Structure Protected Sub SendRequest() Dim Client As WebClient = New WebClient() Dim credentials As String = Convert.ToBase64String(Encoding.ASCII.GetBytes("your_username:your_password")) Client.Headers(HttpRequestHeader.Authorization) = String.Format("Basic {0}", credentials) Client.Headers(HttpRequestHeader.Accept) = "application/json" Client.Headers(HttpRequestHeader.ContentType) = "application/json" Client.BaseAddress = "https://gatiosoft.ro/morsesonat.aspx" Dim j As RequestFields = New RequestFields() j.morse_wav_file = "UYGUYFGFUUHK...base64 encoded...JHUIHGGG" j.normal_text="NO" j.morse_text = "NO" Try Dim js As String = (New JavaScriptSerializer()).Serialize(j) Dim reqString As Byte() = Encoding.[UTF8].GetBytes(js) Dim url As Uri = New Uri(Client.BaseAddress) Dim resByte As Byte() = Client.UploadData(url, "post", reqString) 'The resString below is your needed JSON output Dim resString As String = Encoding.[UTF8].GetString(resByte) If Instr(resString,"normal_text") >0 Then 'In case we got it right without errors Dim r as ResponseField = New ResponseField() Dim j1 As JavaScriptSerializer = New JavaScriptSerializer() 'Below we find in r.audioFileURL the link to wav audio file which may be 'used as source for html5 Audio control for example and play the file. r = j1.Deserialize(Of ResponseField)(resString) Else 'So in case of error occurence Dim e as ErrorFields = New ErrorFields() Dim j2 As JavaScriptSerializer = New JavaScriptSerializer() 'Below we find in e.cd (error code) and e.description (error description) e = j1.Deserialize(Of ErrorFields)(resString) End If Client.Dispose() Catch exception As System.Exception Dim ex As System.Exception = exception Console.Writeline("ERROR: " & ex.Message) End Try End Sub End Class
Sub VBAExcelJson() Url = "https://gatiosoft.ro/morsesonat.aspx" Set dictBody = CreateObject("Scripting.Dictionary") dictBody.Add "morse_wav_file", "GJJBHBH...base64 encoded...HUIIU" dictBody.Add "normal_text", "NO" dictBody.Add "morse_text", "NO" JsonRequestBody = ToJson(dictBody) Dim JsonHttp As Object Set JsonHttp = CreateObject("Microsoft.XMLHTTP") Dim authUser As String authUser = "Your Usernmae" Dim authPass As String authPass = "Your Password" With JsonHttp .Open "POST", Url, False .SetRequestHeader "Authorization", "Basic " + EncodeBase64(authUser + ":" + authPass) .SetRequestHeader "Content_Type", "application/json" .SetRequestHeader "Accept", "application/json" .send (JsonRequestBody) End With Dim JsonResult As String JsonResult = JsonHttp.responseText Cells(1, 1).value = JsonResult End Sub Function EncodeBase64(text As String) As String Dim arrData() As Byte arrData = StrConv(text, vbFromUnicode) Dim objXML As MSXML2.DOMDocument60 Dim objNode As MSXML2.IXMLDOMElement Set objXML = New MSXML2.DOMDocument60 Set objNode = objXML.createElement("b64") objNode.DataType = "bin.base64" objNode.nodeTypedValue = arrData EncodeBase64 = Application.Clean(objNode.text) Set objNode = Nothing Set objXML = Nothing End Function Function ToJson(ByVal dict As Object) As String Dim key As Variant, result As String, value As String result = "{" For Each key In dict.Keys result = result & IIf(Len(result) > 1, ",", "") If TypeName(dict(key)) = "Dictionary" Then value = ToJson(dict(key)) ToJson = value Else value = """" & dict(key) & """" End If result = result & """" & key & """:" & value & "" Next key result = result & "}" ToJson = result End Function
using System; using System.Text; using System.Net; using Newtonsoft.Json; using System.Collections.Generic; public class morse_code_audio_to_text_api { public struct RequestFields { public string morse_wav_file; public string normal_text; public string morse_text; } public struct ResponseField { public string normal_text; public string morse_text; public string audioFileURL; } public struct ErrorFields { public string cd; public string description; } public struct ErrF { public List<ErrorFields> errObj; } protected void SendRequest() { WebClient Client = new WebClient(); string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes("your_username:your_password")); Client.Headers[HttpRequestHeader.Authorization] = string.Format("Basic {0}", credentials); Client.Headers[HttpRequestHeader.Accept] = "application/json"; Client.Headers[HttpRequestHeader.ContentType] = "application/json"; Client.BaseAddress = "https://gatiosoft.ro/morsesonat.aspx"; RequestFields j = new RequestFields(); j.morse_wav_file = "YUIHGYGCYC...base64 encoded...YUGUYGG"; j.normal_text = "NO"; j.morse_text = "NO"; try { string js = JsonConvert.SerializeObject(j); byte[] reqString = Encoding.UTF8.GetBytes(js); Uri url = new Uri(Client.BaseAddress); byte[] resByte = Client.UploadData(url, "post", reqString); // The resString below is your needed JSON output // similar with {"base64AudioString":"//NETgDffgjjskkj===...HgYtyfFFFTTTFVVVV"} string resString = Encoding.UTF8.GetString(resByte); if (resString.IndexOf("normal_text") > 0) { ResponseField r = new ResponseField(); // Below we find in r.audioFileURL which is a link that may be // used as source for html5 Audio control for example and play the file. r = JsonConvert.DeserializeObject<ResponseField>(resString); Console.Write(resString); } else { ErrF e = new ErrF(); // Below we find in e.errObj[0].cd (error code) and e.errObj[0].description (error description) e.errObj = JsonConvert.DeserializeObject<List<ErrorFields>>(resString); Console.Write(e.errObj[0].cd); Console.Write(e.errObj[0].description); } Client.Dispose(); } catch (Exception exception) { System.Exception ex = exception; Console.Write("ERROR: " + ex.Message); } } public static void Main() { morse_code_audio_to_text_api b = new morse_code_audio_to_text_api(); //instantiate the object b.SendRequest(); } }
import java.util.Base64; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.ProtocolException; import java.net.URL; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws IOException { String originalInput = "your_username:your_password"; String credentials = Base64.getEncoder().encodeToString(originalInput.getBytes()); final String POST_PARAMS = "{\n" + "\"morse_wav_file\": \"YGUGUG...base64...YUUYGG\",\r\n" + " \"normal_text\": \"NO\",\r\n" + " \"morse_text\": \"NO\"" + "\n}"; URL obj = new URL("https://gatiosoft.ro/morsesonat.aspx"); HttpURLConnection postConnection = (HttpURLConnection) obj.openConnection(); postConnection.setRequestMethod("POST"); postConnection.setRequestProperty("Authorization", "Basic " + credentials); postConnection.setRequestProperty("Content-Type", "application/json"); postConnection.setRequestProperty("Accept", "application/json"); postConnection.setDoOutput(true); OutputStream os = postConnection.getOutputStream(); os.write(POST_PARAMS.getBytes()); os.flush(); os.close(); int responseCode = postConnection.getResponseCode(); if (responseCode == 200) { //success BufferedReader in = new BufferedReader(new InputStreamReader( postConnection.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in .readLine()) != null) { response.append(inputLine); } in .close(); // print json string result System.out.println(response.toString()); } else { System.out.println("POST NOT WORKED"); } } }
<?php ob_start(); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $data = array('morse_wav_file' => 'UIHGUIGU...base64 encoded...YUGUYGUY', 'normal_text' => 'NO', 'morse_text' => 'NO'); $data_string = json_encode($data); $username = 'your_usernmae'; $password = 'your_password'; $hash = base64_encode($username . ':' . $password); $headers = array( 'Authorization: Basic ' . $hash ); ?><!DOCTYPE html> <html lang="en"> <head> <title>Test MorseSonat API</title> </head> <body> <?php $url = "https://gatiosoft.ro/morsesonat.aspx"; // Where you want to post data try { $ch = curl_init(); if (FALSE === $ch) throw new Exception('failed to initialize'); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); // Tell cURL you want to post something curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); // Define what you want to post curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); //curl_setopt(/* ... */); $content = curl_exec($ch); $info = curl_getinfo($ch); if (FALSE === $content) throw new Exception(curl_error($ch), curl_errno($ch)); } catch(Exception $e) { trigger_error(sprintf( 'Curl failed with error #%d: %s', $e->getCode(), $e->getMessage()), E_USER_ERROR); } echo '<pre>'; print_r($data); echo '</pre>'; echo '<br />'; echo http_build_query(array('data' => $data)); echo '<br /><br />'; $json = json_encode($data); echo "<b>JSON Request is:</b>" ."<br />" . $json . "<br />" . "<br />"; $onlyjson = str_replace("\u0022", '"', $content); echo "<br />" . "<br />" . "<b>JSON Response From API is:</b>" . "<br />" . $onlyjson . "<br />";?> </body> </html>
String URL = "https://gatiosoft.ro/morsesonat.aspx"; JSONObject postparams = new JSONObject(); postparams.put("morse_wav_file", "HJJGJ...base64...IUIUHG"); postparams.put("normal_text", "NO"); postparams.put("morse_text", "NO"); JsonObjectRequest req = new JsonObjectRequest(URL, postparams, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { try { VolleyLog.v("Response:%n %s", response.toString(4)); } catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { VolleyLog.e("Error: ", error.getMessage()); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { String credentials = "username" + ":" + "password"; String base64EncodedCredentials = Base64.encodeToString(credentials.getBytes(), Base64.NO_WRAP); HashMap<String, String> headers = new HashMap<>(); headers.put("Authorization", "Basic " + base64EncodedCredentials); headers.put("Content-Type", "application/json"); headers.put("Accept", "application/json"); return headers; } }; MyApplication.getInstance().addToRequestQueue(req, "headerRequest");
import Foundation import UIKit import Alamofire class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let url = URL(string: "https://gatiosoft.ro/morsesonat.aspx")! // your credentials encoded in base64 let username = "Your username" let password = "Your password" let loginData = String(format: "%@:%@", username, password). data(using: String.Encoding.utf8)! let base64LoginData = loginData.base64EncodedString() let headers = ["Authorization" : "Basic \(base64LoginData)", "Content-Type": "application/json", "Accept": "application/json"] //Prepare paramsBody to send let paramsBody: [String: Any] = ["morse_wav_file": "GGGUI...base64...UYTUYGI", "normal_text": "NO", "morse_text": "NO"] //Make Request Alamofire.request(url, method: .post,parameters: paramsBody, encoding: URLEncoding.default, headers: headers).responseJSON { response in print(response) //get status code if let status = response.response?.statusCode { switch(status){ case 201: print("Success") default: print("Error with response status: \(status)") } } //get JSON return value if let result = response.result.value { let JSON = result as! NSDictionary print(JSON) } } } }
import requests import json import base64 json_string = ' { "morse_wav_file":"IUHIUH...base64...IUHIUGG", "normal_text":"NO", "morse_text":"NO" } ' data = json.loads(json_string) usrPass = b'your_username:your_password' b64Val = base64.b64encode(usrPass) b64Val = str(b64Val,'utf-8') resp = requests.post('https://gatiosoft.ro/morsesonat.aspx', headers={"Authorization": "Basic %s" % b64Val, 'Content-Type': 'application/json', 'Accept': 'application/json'}, json=data) resp_data = resp.json() print(resp_data)
require 'uri' require 'net/https' require 'json' require 'base64' class DoHttpsRequest def call(url, json) uri = URI.parse(url) req = Net::HTTP::Post.new(uri.to_s) req.body = json.to_json req['Content-Type'] = 'application/json' req['Accept'] = 'application/json' req['Authorization'] = 'Basic ' + Base64.strict_encode64("your_username:your_password") response = https(uri).request(req) response.body end private def https(uri) Net::HTTP.new(uri.host, uri.port).tap do |http| http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end end end url = "https://gatiosoft.ro/morsesonat.aspx" input_json = '{ "morse_wav_file":"UIIUGIG...base64...UYGUYG", "normal_text":"NO", "morse_text":"NO" }' puts DoHttpsRequest.new.call(url, input_json)
var request = require('request'); var auth = 'Basic ' + Buffer.from('your_username' + ':' + 'your_password').toString('base64'); var urlapi = 'https://gatiosoft.ro/morsesonat.aspx'; request.post({ url: urlapi, headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': auth }, json: { "morse_wav_file":"OIUOIH...base64...UYGUYG", "normal_text":"NO", "morse_text":"NO" } }, function(error, response, body) { console.log(response) } );
FUNCTION Morse_Code_Audio_To_Text() chttp is un httpRequest creponse is un httpResponse sPassWord is a Buffer = "your_username:your_password" Res_Encode64 is a string = Encode( sPassWord , encodeBASE64) chttp..Header["Authorization"] = "Basic "+ Res_Encode64 chttp..Header["Accept"] = "application/json" chttp..URL = "https://gatiosoft.ro/morsesonat.aspx" chttp..Method = httpPost chttp..ContentType = "application/json" chttp.Content=[ { "morse_wav_file":"OIHOH...base64...UYGUYGYUG", "normal_text":"NO", "morse_text":"NO" } ] chttp.Content=StringToUTF8(chttp.Content) creponse = HTTPSend(chttp) sLink is a string IF ErrorOccurred THEN Error(ErrorInfo(errComplet)) ELSE let vReponseVariant = JSONToVariant("["+creponse.Content+"]") contor is int=0 FOR EACH indice OF vReponseVariant IF contor=0 THEN sLink=indice.audioFileURL END contor=contor+1 END OK is boolean = HTTPRequest(sLink) IF OK = True THEN ArqBuff is Buffer = HTTPGetResult(httpResult) IF InSimulatorMode() = True OK = fSaveBuffer("d:\your_filename.wav",ArqBuff) ELSE OK = fSaveBuffer("/your_filename.wav",ArqBuff) END IF OK = True THEN IF InSimulatorMode() = True OK = fFileExist("d:\your_filename.wav") ELSE OK = fFileExist("/your_filename.wav") END IF OK = True THEN Info("Download successful!") ELSE Error("Error. "+ErrorInfo(errMessage)) END ELSE Error("Error info. "+ErrorInfo(errMessage)) END ELSE Error("URL not responding. "+ErrorInfo(errMessage)) END END
<!DOCTYPE html> <html> <head> <title>Morse Code Audio To Text and Back - MorseSonat</title> </head> <body> //Put the script below before the end of body tag. <script> let url = 'https://cors-anywhere.herokuapp.com/https://gatiosoft.ro/morsesonat.aspx'; let username = 'your_username'; let password = 'your_password'; var data = { morse_wav_file:'IGUIIGIGU...base64...YUFYTFYT', normal_text:'NO', morse_text:'NO' }; var x = new XMLHttpRequest(); x.open('POST', url); x.setRequestHeader('Authorization', 'Basic ' + window.btoa(username + ":" + password)); x.setRequestHeader('Content-Type', 'application/json'); x.setRequestHeader('Accept', 'application/json'); x.onload = x.onerror = function() { if (x.status==200 && x.statusText=='OK') console.log(x.responseText); else console.log("Error"); }; x.send(JSON.stringify(data)); </script> </body> </html>
Morse Code Audio To Text online, MorseSonat, is in the video presentation below. Our Morse Code Audio To Text API or Morse Code Text To Audio functions as a translator. This Morse Sound To text API is for users and developers, Other searches of interested people on this issue are: morse code text to sound, morse audio to text converter, morse audio to text decoder..
Terms and Conditions | Privacy Policy | Cookies | ANPC | ANSPDCP | Contact