MV.AudioMsg 1.0.0

dotnet add package MV.AudioMsg --version 1.0.0
                    
NuGet\Install-Package MV.AudioMsg -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MV.AudioMsg" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MV.AudioMsg" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MV.AudioMsg" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MV.AudioMsg --version 1.0.0
                    
#r "nuget: MV.AudioMsg, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MV.AudioMsg@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MV.AudioMsg&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MV.AudioMsg&version=1.0.0
                    
Install as a Cake Tool

MV.AudioMsg 🎙️

A MV.AudioMsg é uma biblioteca (DLL) desenvolvida em .NET para facilitar a implementação de síntese de voz (Text-to-Speech) em aplicações Windows. Com uma interface simples e eventos nativos, ela permite converter textos em áudio utilizando as vozes instaladas no sistema operacional.

🚀 Funcionalidades Listagem automática de vozes instaladas no Windows.

Controle de velocidade (Rate) e volume.

Execução assíncrona para não travar a interface do usuário.

Eventos integrados: início, progresso e conclusão da fala.

🖼️ Demonstração Abaixo, um exemplo da interface simples criada para demonstrar o consumo da DLL:

Formulario de exemplo

🛠️ Como usar Para utilizar a biblioteca em seu projeto, instale MV.AudioMsg pelo nuget e utilize o namespace MV.AudioMsg.ServiceContract.

Exemplo de Implementação Aqui está um exemplo prático de como configurar um formulário WinForms para utilizar a biblioteca:

using MV.AudioMsg; using MV.AudioMsg.ServiceContract; using System.Speech.Synthesis;

public partial class Form1 : Form
{
    
    private InstalledVoice _selectedVoice;
    
    private readonly ISpeechService _iSpeechService;
    
    public Form1()
    {
        InitializeComponent();
        // Inicializa o serviço de voz
        _iSpeechService = new SpeechService();
        ConfigureSpeechEvents();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        LoadVoices();
        if (comboBoxVoz.Items.Count > 0)
            comboBoxVoz.SelectedIndex = 0;
    }

    private void ConfigureSpeechEvents()
    {
        _iSpeechService.SpeakProgress += OnSpeakProgress;
        _iSpeechService.SpeakStarted += OnSpeakStarted;
        _iSpeechService.SpeakCompleted += OnSpeakCompleted;
    }

    private void LoadVoices()
    {
        var voices = _iSpeechService.GetInstalledVoices();
        comboBoxVoz.Items.Clear();
        foreach (var item in voices)
        {
            comboBoxVoz.Items.Add(item.VoiceInfo.Name);
        }
    }

    private void GenerateSpeech()
    {
        string text = txtTexto.Text;
        
        if (string.IsNullOrEmpty(text) || _selectedVoice == null)
        {
            MessageBox.Show("Digite um texto e selecione uma voz!", "Aviso!");
            return;
        }

        _iSpeechService.CancelAll(); // Cancela falas anteriores

        _iSpeechService.SetVoice(_selectedVoice.VoiceInfo.Name);
        _iSpeechService.SetRate(6); // Define a velocidade
        _iSpeechService.SetVolume(100);
        _iSpeechService.SpeakAsync(text);
    }

    private void comboBoxVoz_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (comboBoxVoz.SelectedItem != null)
        {
            string voiceName = comboBoxVoz.SelectedItem.ToString();
            var voices = _iSpeechService.GetInstalledVoices();
            _selectedVoice = voices.FirstOrDefault(v => v.VoiceInfo.Name == voiceName);
        }
    }

    private void btnGerar_Click(object sender, EventArgs e)
    {
        GenerateSpeech();
    }

    // Handlers para eventos de voz (atualize a UI se necessário)
    private void OnSpeakProgress(object sender, SpeakProgressEventArgs e) { /* Lógica aqui */ }
    private void OnSpeakStarted(object sender, SpeakStartedEventArgs e) { /* Lógica aqui */ }
    private void OnSpeakCompleted(object sender, SpeakCompletedEventArgs e) { /* Lógica aqui */ }
}

📦 Instalação Clone o repositório:

Bash git clone https://github.com/xX-Mill3r-Xx/MV.Audio.git Busque por MV.AudioMsg no nuget e adicione como referência no seu projeto .NET.

Certifique-se de que o sistema possui vozes instaladas (Configurações do Windows > Hora e Idioma > Fala).

Desenvolvido por xX-Mill3r-Xx

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 143 2/17/2026