{"id":19809314,"url":"https://github.com/p6laris/morsesharp","last_synced_at":"2025-10-27T15:39:13.652Z","repository":{"id":65497373,"uuid":"542162063","full_name":"p6laris/MorseSharp","owner":"p6laris","description":"MorseSharp is a .NET library to Encoding/decoding sentences to morse code for up to 10 languages including kurdish and generating dash and dots wav audio, light blinker.","archived":false,"fork":false,"pushed_at":"2025-04-11T16:02:16.000Z","size":194,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-19T05:31:42.765Z","etag":null,"topics":["dotnet","dotnet-library","dotnet-morse","dotnetcore","kurdish","kurdish-language","morse-code","morse-kurdish","morse-learning","morse-translator","morsecode","wav","waveform-generator"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p6laris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-27T15:38:03.000Z","updated_at":"2025-04-11T15:57:56.000Z","dependencies_parsed_at":"2023-11-18T03:30:36.862Z","dependency_job_id":"b22159f3-4fea-4f4c-855b-8131ed112abf","html_url":"https://github.com/p6laris/MorseSharp","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/p6laris/MorseSharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p6laris%2FMorseSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p6laris%2FMorseSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p6laris%2FMorseSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p6laris%2FMorseSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p6laris","download_url":"https://codeload.github.com/p6laris/MorseSharp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p6laris%2FMorseSharp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266796891,"owners_count":23985492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","dotnet-library","dotnet-morse","dotnetcore","kurdish","kurdish-language","morse-code","morse-kurdish","morse-learning","morse-translator","morsecode","wav","waveform-generator"],"created_at":"2024-11-12T09:16:33.811Z","updated_at":"2025-10-27T15:39:13.646Z","avatar_url":"https://github.com/p6laris.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MorseSharp\n[![NuGet](https://img.shields.io/nuget/dt/MorseSharp?logo=nuget)](https://www.nuget.org/packages/MorseSharp)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/p6laris/MorseSharp)\n\nMorseSharp is a fast .NET library to encoding/decoding  **up to 10 languages** including kurdish and generating audio , blinking lights for morse dash and dots.\n\n![alt text](https://github.com/p6laris/MorseSharp/blob/master/MorseSharp.png?raw=true)\n\n## Supported Languages\n\n| Language      | Enum Value   |\n|---------------|--------------|\n| English       | `Language.English` |\n| Kurdish       | `Language.Kurdish` |\n| Kurdish Latin | `Language.KurdishLatin` |\n| Arabic        | `Language.Arabic` |\n| Deutsch       | `Language.Deutsch` |\n| Espanol       | `Language.Spanish` |\n| Francais      | `Language.French` |\n| Italiano      | `Language.Italian` |\n| Japanese      | `Language.Japanese` |\n| Portugues     | `Language.Portugues` |\n| Russian       | `Language.Russian` |\n\nNOTE: All language sources are obtained from [MorseCoder](https://morsedecoder.com/), except for Kurdish, Kurdish Latin [More info](https://github.com/p6laris/MorseSharp/blob/master/KurdishToMorse.md) and Russian obtained from this [wiki](https://en.wikipedia.org/wiki/Russian_Morse_code).\nIf you encounter any issues with the obtained characters or have suggestions for improvement, please feel free to [open an issue](https://github.com/p6laris/MorseSharp/issues) in this repository.\n\n\n## Installation\nUse nuget package manager to install [MorseSharp](https://www.nuget.org/packages/MorseSharp).\n```bash\nInstall-Package MorseSharp\n```\n## Usage\nEffortlessly decode/encode Morse code, generate audio, and control blinking lights using the fluent `Morse` class. Begin by obtaining a singleton instance through the `GetConverter()` method and specifying your desired language using the `ForLanguage` method and pass the `Language` enum to it.\n\n```C#\nusing MorseSharp;\n\nvar conv = Morse.GetConverter()\n     .ForLanguage(Language.English);\n```\n\n## Text\nOnce you've set the language via the `ForLanguage` method, you can decode/encode Morse code with a series of method calls.\n\n#### Encoding\nUtilize the `ToMorse` method to encode your text into Morse code, and then call the `Encode` method to obtain the Morse code as a string:\n\n```C#\nusing MorseSharp;\n\n var morse = Morse.GetConverter()\n     .ForLanguage(Language.English)\n     .ToMorse(\"Hi\")\n     .Encode();\n```\n\n:warning: __WordNotPresentedException__ will be throw when a character in the input text does not have a corresponding Morse code representation.\n\n\n#### Decoding\nto decode Morse code using the `Decode` method:\n \u003e :exclamation: ``Words must be separated by ( / ), Letters by space \" \".``\n\n```C#\nusing MorseSharp;\n\nvar text = Morse.GetConverter()\n    .ForLanguage(Language.English)\n    .Decode(\".... ..\");\n\n```\n:warning: __SequenceNotFoundException__ when an invalid Morse code sequence is encountered, and the corresponding character cannot be found.\n\n## Audio\nYou have two options to generate audio:\n\n#### By Encoding The Text\nEncode your text using `ToMorse`, and then proceed through the chain to generate audio for the encoded text. After encoding the text, use the `ToAudio` method, set the audio options with `SetAudioOptions`, and finally, retrieve audio bytes using `GetBytes`:\n\n```C#\nusing MorseSharp;\n\n Morse.GetConverter()\n     .ForLanguage(Language.English)\n     .ToMorse(\"Hello Morse\")\n     .ToAudio()\n     .SetAudioOptions(25, 25, 600)\n     .GetBytes(out Span\u003cbyte\u003e morse);\n```\n\n#### Manually\nIf you already have the encoded text as a string, skip the encoding step and pass the encoded text directly to the overloaded `ToAudio` method:\n```C#\nusing MorseSharp;\n\nMorse.GetConverter()\n    .ForLanguage(Language.English)\n    .ToAudio(\".... ..\")\n    .SetAudioOptions (25, 25, 600)\n    .GetBytes(out Span\u003cbyte\u003e morse);\n\n```\n:warning: The character speed must be greater than or equal to the word speed; otherwise, a __SmallerCharSpeedException__ will be thrown.\n\n## Light\nThe class can also be able to blink lights to a specific morse. Just like the audio you have to options to blink lights either by Encoding it first or by set the dash and dots directly to the method and skip the encoding part:\n\n```C#\nusing MorseSharp;\n\n //By Encoding it then blink the lights.\nawait Morse.GetConverter()\n    .ForLanguage(Language.Kurdish)\n    .ToMorse(\"سڵاو\")\n    .ToLight()\n    .SetBlinkerOptions(25, 25)\n    .DoBlinks((hasToBlink) =\u003e {\n       //Do something\n    });\n\n//By directly pass the morse to method.\n await Morse.GetConverter()\n     .ForLanguage(Language.English)\n     .ToLight(\".... ..\")\n     .SetBlinkerOptions(25, 25)\n     .DoBlinks((hasToBlink) =\u003e\n     {\n         if (hasToBlink)\n             Console.BackgroundColor = ConsoleColor.White;\n         else \n             Console.BackgroundColor = ConsoleColor.Black;\n     });\n```\nYou need to set the character speed and word speed using `SetBlinkerOptions`, then invoke async `DoBlinks` and subscribe to the `Action\u003cbool\u003e parameter`.\n\n## Example \nThis piece of code encode and decode's the morse and then show it to the console, also blinks the console background based on the light blink:\n```C#\nusing MorseSharp;\n\n\ntry\n{\n    //Encoding\n    var morse = Morse.GetConverter()\n        .ForLanguage(Language.English)\n        .ToMorse(\"Hi\")\n        .Encode();\n\n    //Decoding\n    var text = Morse.GetConverter()\n        .ForLanguage(Language.English)\n        .Decode(\".... ..\");\n\n    //Light Blinking\n    await Morse.GetConverter()\n        .ForLanguage(Language.English)\n        .ToLight(\".... ..\")\n        .SetBlinkerOptions(25, 25)\n        .DoBlinks((hasToBlink) =\u003e\n        {\n            if (hasToBlink)\n                Console.BackgroundColor = ConsoleColor.White;\n            else \n                Console.BackgroundColor = ConsoleColor.Black;\n        });\n\n}\ncatch(Exception ex)\n{\n    Console.WriteLine(ex.Message);\n}\n```\n\n## License\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp6laris%2Fmorsesharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp6laris%2Fmorsesharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp6laris%2Fmorsesharp/lists"}