WavReader和FlacWriter我需要什么使用语句?

问题描述 投票:0回答:2

到目前为止,我有这些using语句:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
using Newtonsoft.Json;
using System.Threading;
using NAudio.Wave;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using Alvas.Audio;

我正在尝试编写一个WAV到FLAC转换器。这是函数:

public static void flac_converter()
{
    string inputFile = Path.Combine("wav ", input);
    string outputFile = Path.Combine("flac", Path.ChangeExtension(input, ".flac"));

    if (!File.Exists(inputFile))
        throw new ApplicationException("Input file " + inputFile + " cannot be found!");

    WavReader wav = new WavReader(inputFile);

    using (var flacStream = File.Create(outputFile))
    {
        FlacWriter flac = new FlacWriter(flacStream, wav.BitDepth, wav.Channels, wav.SampleRate);
        // Buffer for 1 second's worth of audio data
        byte[] buffer = new byte[wav.Bitrate / 8];
        int bytesRead;
        do
        {
            bytesRead = wav.InputStream.Read(buffer, 0, buffer.Length);
            flac.Convert(buffer, 0, bytesRead);
        } while (bytesRead > 0);
        flac.Dispose();
        flac = null;
    }
}

但是我收到此错误:“找不到命名空间'WavReader'的类型”我也收到此错误:“找不到类型或命名空间'FlacWriter'”

[我知道我必须做两件事,下载适当的库,然后将所有DLL文件下载到项目的引用,并添加“ using blahBlah;”]]

但是,我不知道我需要什么DLL,或者我需要哪些使用语句来消除这些错误。有人知道吗?

到目前为止,我有以下using语句:using System;使用System.Collections.Generic;使用System.Linq;使用System.Text;使用System.IO;使用System.Net;使用Newtonsoft.Json;使用系统。...

c# dll using statements
2个回答
0
投票

将wavreader的拼写更改为wavereader。它应该解决。


-1
投票

在此链接中,我发现FlacWriter的实现C# (CSharp) TellCallback Examples

© www.soinside.com 2019 - 2024. All rights reserved.