[C#] Mic aufnehmen



  • Hallo,

    Gibt es irgendeine (wenn möglich free) Lib, mit der man in C# das Mikrofon, schnell und leicht aufnehmen kann?

    Habe bisher nur LumiSoft.NET als rel. annehmbare Lib. gefunden, jedoch funktioniert das Ganze bei mir überhaupt nicht, Doku ist ja leider keine vorhanden.

    MfG Audio



  • HAt sich erledigt, habe endlich etwas funktionierendes gefunden, hier der Code für alle die's brauchen:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Microsoft.VisualBasic.Devices;
    using Microsoft.VisualBasic;
    using System.Runtime.InteropServices;
    
    namespace Test
    {
    
        public partial class Form1 : Form
        {
            [DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                // record from microphone
                mciSendString("open new Type waveaudio Alias recsound", "", 0, 0);
                mciSendString("record recsound", "", 0, 0);
            }
    
            private void button2_Click(object sender, EventArgs e)
            {
                // stop and save
                mciSendString("save recsound c:\\record.wav", "", 0, 0);
                mciSendString("close recsound ", "", 0, 0);
                Computer c = new Computer();
                c.Audio.Stop();
    
            }
    
            private void button3_Click(object sender, EventArgs e)
            {
                Computer computer = new Computer();
                computer.Audio.Play("c:\\record.wav", AudioPlayMode.Background);
            }
        }
    }
    


  • Schonmal mit der BASS.dll hantiert ???



  • die Computer-Klasse ist ja drollig


Anmelden zum Antworten