Hi.
Is there a morse decoder dll somewhere for free use wchich work with C#?
Pages 1
You are not logged in. Please login or register.
AudioGames.net Forum → Developers room → DLL for morse decoder?
Hi.
Is there a morse decoder dll somewhere for free use wchich work with C#?
That depends. In what form is this morse code in? Recorded audio? Image data? Arrays?
He probably means audio as it's "recorded". That is the app we're both working on, I have found a solution however it requires me to do some crazy math to succeed. I can do that, but isn't there another way?
you could look up the morse codes on wikipedia and create one your self. I was searching for one as well, but I figured it would have better to find the morse table. The problem is that the one I found wasn't quite understandable with a screen reader.
I have written a Morse Text Decoder, if anyone is interested.
Here you go.
The code is written in C#, and this is not a completely functional rpogram, as the decoder is part of something bigger.
Morse inserted to function must be space delimited
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Morse_Decoder
{
public static class MorseMethods
{
public static Dictionary<string, char> morseCodeLookup = new Dictionary<string, char>()
{
[".-"] = 'a',
["-..."] = 'b',
["-.-."] = 'c',
["-.."] = 'd',
["."] = 'e',
["..-."] = 'f',
["--."] = 'g',
["...."] = 'h',
[".."] = 'i',
[".---"] = 'j',
["-.-"] = 'k',
[".-.."] = 'l',
["--"] = 'm',
["-."] = 'n',
["---"] = 'o',
[".--."] = 'p',
["--.-"] = 'q',
[".-."] = 'r',
["..."] = 's',
["-"] = 't',
["..-"] = 'u',
["...-"] = 'v',
[".--"] = 'w',
["-..-"] = 'x',
["-.--"] = 'y',
["--.."] = 'z',
[".----"] = '1',
["..---"] = '2',
["...--"] = '3',
["....-"] = '4',
["....."] = '5',
["-...."] = '6',
["--..."] = '7',
["---.."] = '8',
["----."] = '9',
["-----"] = '0',
};
public static string DecodeText(string TextToDecode)
{
string Result = "";
string Temp = "";
string[] MorseTextSplit = TextToDecode.Split(' ');
foreach (var item in MorseTextSplit)
{
try
{
Result += morseCodeLookup[item];
}
catch
{
System.Windows.Forms.MessageBox.Show("The entered morse code cannot be recognized.", "Error",System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
return "An error has occured";
}
}
return Result;
}
}
}
AudioGames.net Forum → Developers room → DLL for morse decoder?
Generated in 0.024 seconds (35% PHP - 65% DB) with 9 queries