• 大小: 283KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-09
  • 语言: C#
  • 标签: c#  录音  

资源简介

实现录制wav音频,并可随意选择采样率,样本精度。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.DirectX;
using Microsoft.DirectX.DirectSound;

namespace Record
{
    class Common
    {
        public class RecordDriver
        {
            public string StrDescription;
            public Guid GuidDriver;

            public RecordDriver()
            {
                StrDescription = string.Empty;
                GuidDriver = Guid.Empty;
            }
        }       

        /// 
        /// 获得录音设备列表
        /// 

        /// 可用的录音设备列表若没有可用的录音设别,返回null
        public static List GetRecordDriverCollection()
        {
            CaptureDevicesCollection captDeviceCollection = new CaptureDevicesCollection();
            if (captDeviceCollection == null || captDeviceCollection.Count == 0)
            {
                return null;
            }
            List lstCaptDevice = null;
            for (int i = 0; i < captDeviceCollection.Count; ++i)
            {
                if (captDeviceCollection[i].DriverGuid != Guid.Empty)
                {
                    if (lstCaptDevice == null)
                    {
                        lstCaptDevice = new List();
                    }
                    RecordDriver recordDevice = new RecordDriver();
                    recordDevice.GuidDriver = captDeviceCollection[i].DriverGuid;
                    recordDevice.StrDescription = captDeviceCollection[i].Description;
                    lstCaptDevice.Add(recordDevice);
                }
            }
            return lstCaptDevice;
        }        
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        203  2013-03-21 15:55  Record\Record\App.config

     文件      47616  2013-07-27 16:44  Record\Record\bin\Debug\Record.exe

     文件        203  2013-03-21 15:55  Record\Record\bin\Debug\Record.exe.config

     文件      54784  2013-07-27 16:44  Record\Record\bin\Debug\Record.pdb

     文件      11600  2013-08-09 09:39  Record\Record\bin\Debug\Record.vshost.exe

     文件        203  2013-03-21 15:55  Record\Record\bin\Debug\Record.vshost.exe.config

     文件        490  2012-06-06 02:06  Record\Record\bin\Debug\Record.vshost.exe.manifest

     文件       1791  2013-03-21 17:22  Record\Record\Common.cs

     文件     178176  2013-01-13 23:38  Record\Record\dll\Microsoft.DirectX.DirectSound.dll

     文件     223232  2013-01-13 23:38  Record\Record\dll\Microsoft.DirectX.dll

     文件       5420  2013-08-09 09:39  Record\Record\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6678  2013-07-27 16:44  Record\Record\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       8249  2013-08-09 09:39  Record\Record\obj\x86\Debug\Record.csproj.FileListAbsolute.txt

     文件       1039  2013-07-27 16:44  Record\Record\obj\x86\Debug\Record.csproj.GenerateResource.Cache

     文件      16707  2013-07-27 16:44  Record\Record\obj\x86\Debug\Record.csprojResolveAssemblyReference.cache

     文件      47616  2013-07-27 16:44  Record\Record\obj\x86\Debug\Record.exe

     文件      54784  2013-07-27 16:44  Record\Record\obj\x86\Debug\Record.pdb

     文件        180  2013-06-07 17:42  Record\Record\obj\x86\Debug\Record.Properties.Resources.resources

     文件        180  2013-06-07 17:42  Record\Record\obj\x86\Debug\Record.WndMain.resources

     文件      23197  2013-06-07 17:42  Record\Record\obj\x86\Debug\Record.WndRecord.resources

     文件       9710  2012-12-27 12:13  Record\Record\pic\bg_voice0.png

     文件       5208  2012-12-27 12:13  Record\Record\pic\btn_cancel.png

     文件       5422  2012-12-27 12:13  Record\Record\pic\btn_stop.png

     文件        489  2013-03-21 15:10  Record\Record\Program.cs

     文件       1344  2013-03-21 14:44  Record\Record\Properties\AssemblyInfo.cs

     文件       2862  2013-03-21 14:44  Record\Record\Properties\Resources.Designer.cs

     文件       5612  2013-03-21 14:44  Record\Record\Properties\Resources.resx

     文件       1091  2013-03-21 14:44  Record\Record\Properties\Settings.Designer.cs

     文件        249  2013-03-21 14:44  Record\Record\Properties\Settings.settings

     文件       4330  2013-06-07 17:40  Record\Record\Record.csproj

............此处省略24个文件信息

评论

共有 条评论