{"id":16735459,"url":"https://github.com/thomasthaddeus/ttssolution","last_synced_at":"2025-11-06T08:03:27.270Z","repository":{"id":155702822,"uuid":"620144051","full_name":"thomasthaddeus/TTSSolution","owner":"thomasthaddeus","description":"TTS Application written in C#","archived":false,"fork":false,"pushed_at":"2024-06-23T10:01:07.000Z","size":266,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T01:06:19.156Z","etag":null,"topics":["csharp","text-to-speech","tts"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomasthaddeus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-28T05:42:50.000Z","updated_at":"2024-06-23T10:01:04.000Z","dependencies_parsed_at":"2024-06-23T11:22:12.061Z","dependency_job_id":null,"html_url":"https://github.com/thomasthaddeus/TTSSolution","commit_stats":null,"previous_names":["thomasthaddeus/ttssolution"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasthaddeus%2FTTSSolution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasthaddeus%2FTTSSolution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasthaddeus%2FTTSSolution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasthaddeus%2FTTSSolution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomasthaddeus","download_url":"https://codeload.github.com/thomasthaddeus/TTSSolution/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239241422,"owners_count":19605933,"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","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":["csharp","text-to-speech","tts"],"created_at":"2024-10-13T00:06:00.546Z","updated_at":"2025-10-31T23:30:19.986Z","avatar_url":"https://github.com/thomasthaddeus.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text-To-Voice\n\nRedux:          #11 \\\nAuthor:         Thaddeus Thomas \\\nDate:           2023-03-27 \\\nProject:        Text-To-Voice \\\nCloud:          Azure\n\n- [Text-To-Voice](#text-to-voice)\n  - [Initial Setup Implementation](#initial-setup-implementation)\n    - [Additional Requirements](#additional-requirements)\n    - [Documentation](#documentation)\n    - [Finalize your application](#finalize-your-application)\n    - [Configuration](#configuration)\n    - [Bundle libraries and dependencies](#bundle-libraries-and-dependencies)\n    - [Create an executable](#create-an-executable)\n    - [Create an installer](#create-an-installer)\n    - [User prompts for configuration](#user-prompts-for-configuration)\n    - [Testing](#testing)\n  - [Defining the Structure](#defining-the-structure)\n    - [Tree Structure](#tree-structure)\n  - [Estimated Size](#estimated-size)\n  - [C# Vs. Python](#c-vs-python)\n    - [Python for .NET (Pythonnet)](#python-for-net-pythonnet)\n    - [IronPython](#ironpython)\n    - [Performance](#performance)\n    - [Dependency management](#dependency-management)\n    - [Debugging](#debugging)\n  - [PowerPointScraper](#powerpointscraper)\n\n## Initial Setup Implementation\n\n1. A project called TextToSpeech,\n2. A project called PptxScraper:\n    - Scrapes the text in the notes of a PowerPoint presentation or on the slides or both,\n3. Project ExpansionScraper (future implementation of other data types),\n4. Project tests (standard C# tests project)\n5. Project TTS-GUI that holds the solution file.\n\n### Additional Requirements\n\nA rotating voice gallery that asks for neural paths before execution of the file. These neural paths would rotate who is speaking based on length of sentence. That is the least important part right now though.\nMy first question is am I missing anything for project files? Such as static files, authentication sections or is this a well-rounded initial application design?\n\n---\n\n1. Configuration\n   - Include a project or folder for configuration files, where you can store settings related to the application, such as API keys, paths to neural voice models, or any other configuration information.\n2. Libraries and dependencies\n   - Ensure you have the necessary external libraries and NuGet packages for each project. For instance, you'll likely need a library to interact with PowerPoint files (e.g., GemBox.Presentation) for the PptxScraper project and a Text-to-Speech library (e.g., Microsoft.CognitiveServices.Speech) for the TextToSpeech project.\n3. Common Utilities\n   - You might want to create a separate project or folder for common utility classes and functions that can be shared across different projects. This can help with code reusability and maintainability.\n4. Logging and Error Handling\n   - Consider implementing a logging mechanism to track application execution and handle errors efficiently. This can be done using a dedicated logging library like NLog or Serilog, or by implementing your custom logging solution.\n5. Security and Authentication\n   - If your application needs to access secure resources or enforce user authentication, you should plan for implementing proper security measures. You can use built-in .NET Core Identity for user authentication and authorization.\n\n### Documentation\n\n1. Include proper documentation for each project.\n    - README files\n    - Inline code comments\n    - XML documentation for public APIs\n\nNeeds documentation of the configuration, libraries and dependencies, common utilities, logging and error handling, security and authentication, and documentation for a more comprehensive design.\n\nMy goal for this project is to have an executable that could be installed by a user with the only need they would have for installation to be inputting the cognitive services endpoint or key.\n\n### Finalize Application\n\nComplete the development and testing of application, ensuring all projects are working as expected.\n\n### Configuration\n\nMake sure the application's configuration settings (e.g., Cognitive Services endpoint or key) can be easily updated by the end-user.\nOne approach is to store these settings in an `appsettings.json` file, which can be modified post-installation.\n\n### Bundle libraries and dependencies\n\nEnsure that all the required libraries and dependencies are included in your application's output. You can achieve this by setting \"Copy Local\" to \"True\" for all referenced assemblies in your projects.\n\n### Create an executable\n\nBuild your solution in Release mode, and make sure the output contains an executable (.exe) file for your TTS-GUI project. You may want to use a tool like Fody/Costura to embed all dependencies into a single executable file for easier distribution.\n\n### Create an installer\n\nUse an installer creation tool, such as Inno Setup, NSIS, or Advanced Installer, to create an installer package for your application. These tools will help you to create a professional-looking installer, which will handle the installation process, create shortcuts, and optionally configure the app settings (like the Cognitive Services endpoint/key).\n\n### User prompts for configuration\n\nDuring the installation process, you can prompt the user for necessary configuration information (e.g., Cognitive Services endpoint or key) using the installer tool's built-in features. This way, the user won't have to edit the configuration file manually.\n\n### Testing\n\nTest the installer on different Windows versions and configurations to ensure that your application installs correctly and works as expected.\n\nBy following these steps, you'll be able to create an installer for your application that can be easily installed by the end-user. They will only need to input the required Cognitive Services endpoint or key during the installation process, and your application should work seamlessly.\n\n## Defining the Structure\n    \nThis structure allows for more modular code organization, which should make it easier to debug, maintain, and expand the application. \\\nEach project can be focused on a specific aspect of the application, reducing complexity and improving code readability.\n\n1. **TextToSpeech**: Handles the text-to-speech functionality.\n1. **PptxScraper**: Scrapes the text from PowerPoint presentations.\n1. **ExpansionScraper**: Future implementation for other data types.\n1. **Tests**: Standard C# tests project.\n1. **TTS-GUI**: The main GUI project that holds the solution file.\n1. **Configuration**: Handles configuration files and settings.\n1. **CommonUtilities**: A project for shared utility classes and functions.\n1. **Logging**: Handles logging and error handling for the application.\n1. **Security**: If required, you can create a separate project to handle security and authentication.\n1. **DataModels**: You can create a separate project to define the data models and entities used in your application.\n\n### Tree Structure\n\nFolder structure to a depth of 3 from the solution file folder \n\n```arduino\nTTS-Solution\n│   TTS-Solution.sln\n│\n├───TextToSpeech\n│   ├───Properties\n│   └───Services\n│\n├───PptxScraper\n│   ├───Properties\n│   └───Services\n│\n├───ExpansionScraper\n│   ├───Properties\n│   └───Services\n│\n├───Tests\n│   ├───Properties\n│   └───TestCases\n│\n├───TTS-GUI\n│   ├───Properties\n│   └───Views\n│\n├───Configuration\n│   └───Settings\n│\n├───CommonUtilities\n│   ├───Properties\n│   └───Helpers\n│\n├───Logging\n│   ├───Properties\n│   └───Services\n│\n├───Security (optional)\n│   ├───Properties\n│   └───Services\n│\n└───DataModels (optional)\n    ├───Properties\n    └───Models\n```\n\nThis structure includes folders for each project, with a \"Properties\" and \"Services\" (or other relevant) folder inside each project.\n\n## Estimated Size\n\nwhats the estimated size of this project with all ten projects in the solution at completion of this project?\nEstimating the size of a project at completion can be challenging without knowing the exact code, dependencies, and resources that will be used. However, I can provide you with a rough estimation based on the projects in the solution.\nTypically, a moderately sized C# project with the structure you've described might range from a few hundred kilobytes to several megabytes in size, excluding external libraries and dependencies.\n\nHere's a rough breakdown of the project sizes:\n\n   1. Source code: The size of your source code files (C# files, XAML files, etc.) will depend on the complexity of your application. For a moderate-sized application, you can expect a few hundred kilobytes.\n   2. Libraries and dependencies: External libraries (NuGet packages) can vary greatly in size. For example, GemBox.Presentation might be around 5-10 MB, while Microsoft.CognitiveServices.Speech could be around 20-30 MB. The total size of your libraries and dependencies might range from 30 MB to 100 MB, depending on your project's requirements.\n   3. Resources: If your application includes multimedia files (images, audio files, etc.), their size will contribute to the overall size of your project. These can vary greatly depending on the quantity and quality of the resources used.\n   4. Executables and build artifacts: The compiled executable files, including the main application and test projects, will also contribute to the project size. This could range from a few hundred kilobytes to several megabytes, depending on the complexity of your code and optimizations.\n\nBased on these factors, the total size of your project could range from around 50 MB to a few hundred MB, considering libraries, dependencies, resources, and build artifacts. Keep in mind that these are rough estimates, and the actual size of your project may vary based on your specific implementation and requirements.\n\n## C# Vs. Python\n\nhow difficult is it to integrate python into C#\nIntegrating Python into a C# application can be achieved using Python for .NET (Pythonnet) or IronPython. Both options allow you to run Python code within a .NET application and enable interaction between C# and Python code.\n\nHere's a brief overview of both options:\n\n### Python for .NET (Pythonnet)\n\nPythonnet is a package that provides a low-level bridge between C# and Python. It enables you to run CPython scripts from your .NET application and allows you to call Python libraries and functions from C# code.\n\nTo use Pythonnet, you can follow these steps:\n\n1. Install Pythonnet via NuGet (Package name: Pythonnet.PyQt5).\n1. Ensure that you have Python installed on your system and the environment variable PYTHONNET_PYTHON is set to your Python executable's path.\n1. Here's a simple example of using Pythonnet in C#:\n\n```csharp\nusing Python.Runtime;\n\nclass Program\n{\n    static void Main(string[] args)\n    {\n        using (Py.GIL()) // Acquire the Python GIL (Global Interpreter Lock)\n        {\n            dynamic np = Py.Import(\"numpy\");\n            double[] myArray = new double[] { 1, 2, 3, 4, 5 };\n            dynamic npArray = np.array(myArray);\n            Console.WriteLine(npArray);\n        }\n    }\n}\n```\n\n### IronPython\n\nIronPython is an open-source implementation of Python that runs on the .NET Framework. It allows you to seamlessly integrate Python code with .NET applications.\n\nTo use IronPython, you can follow these steps:\n\nInstall IronPython via NuGet (Package name: IronPython).\nInstall IronPython Standard Library via NuGet (Package name: IronPython.StdLib).\nHere's a simple example of using IronPython in C#:\n\n```csharp\nusing IronPython.Hosting;\nusing Microsoft.Scripting.Hosting;\n\nclass Program\n{\n    static void Main(string[] args)\n    {\n        ScriptEngine engine = Python.CreateEngine();\n        ScriptScope scope = engine.CreateScope();\n\n        engine.Execute(\"import math\", scope);\n        dynamic math = scope.GetVariable(\"math\");\n        double result = math.sqrt(4);\n\n        Console.WriteLine(result); // Output: 2.0\n    }\n}\n```\n\nWhile integrating Python into C# is not overly difficult, there are some caveats to keep in mind:\n\n### Performance\n\nRunning Python code in a C# application can introduce performance overhead, especially when frequently exchanging data between C# and Python.\n\n### Dependency management\n\nYou may need to manage Python dependencies and ensure that they are available on the target system.\n\n### Debugging\n\nDebugging mixed C# and Python code can be more challenging compared to working with a single language.\nIf you decide to integrate Python into your C# application, be prepared to handle these challenges and consider whether the benefits of using Python outweigh the potential drawbacks.\n\n## PowerPointScraper\n\nThis code defines a PowerPointScraper class that includes a method named ExtractTextFromPresentation. This method takes a file path as input and returns a list of strings containing the extracted text from the PowerPoint presentation. The method uses the DocumentFormat.OpenXml library to open the presentation and iterate through its slides and shapes, extracting the text content of each shape.\n\nHere's a step-by-step explanation of the code:\n\n1. A new class `PowerPointScraper` is defined.\n2. The `ExtractTextFromPresentation` method is declared with a string parameter `filePath`.\n3. A new list of strings named `textList` is created to store the extracted text.\n4. The presentation document is opened using `PresentationDocument.Open`, and a `using` statement is used to ensure proper disposal of the file.\n5. The `PresentationPart` of the presentation is retrieved.\n6. If the `PresentationPart` is not null, the method iterates through the `SlideIdList` to access each slide in the presentation.\n7. For each slide, the `SlidePart` is retrieved.\n8. If the `SlidePart` is not null, the method iterates through the `Descendants\u003cShape\u003e` to access each shape on the slide.\n9. If the shape has a `TextBody`, the method iterates through the `Descendants\u003cDocumentFormat.OpenXml.Drawing.Paragraph\u003e` to access each paragraph in the shape.\n10. The text content of the paragraph is retrieved using the InnerText property.\n11. If the text is not empty or whitespace, it is added to the textList.\n12. Once all slides and shapes have been processed, the method returns the textList, which contains the extracted text from the PowerPoint presentation.\n\nTo use this PowerPointScraper class in your application, you can create an instance of the class and call the ExtractTextFromPresentation method with the file path of the PowerPoint file you want to process. For example:\n\n```csharp\nusing PptxScraper;\n\nclass Program\n{\n    static void Main(string[] args)\n    {\n        string filePath = \"path/to/your/presentation.pptx\";\n        PowerPointScraper powerPointScraper = new PowerPointScraper();\n        IList\u003cstring\u003e extractedTextList = powerPointScraper.ExtractTextFromPresentation(filePath);\n\n        foreach (string text in extractedTextList)\n        {\n            Console.WriteLine(text);\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasthaddeus%2Fttssolution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomasthaddeus%2Fttssolution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasthaddeus%2Fttssolution/lists"}