BASS.NET 라이브러리에서 오디오로 응용 프로그램을 만들려고하지만 "My First BASS Application"샘플에서 약간의 오류가 발생합니다. 나는 http://bass.radio42.com/help/에 주어진 방향을 따라,하지만 난 붙여 넣은 코드를 실행하려고하면 오류가이 라인에 온다 :"My First BASS Application"BASS.NET 응용 프로그램 오류
if (Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero))
내가받을 오류는 다음과 같습니다
An unhandled exception of type 'System.TypeInitializationException' occurred in Bass Test.exe
I 모든 방향을 따르려고했지만 # 4 대신 bass.dll을 추가하는 대신 bass.net.dll이 오타라고 생각했습니다.
4.Copy the 'bass.dll' to your executable directory (e.g. .\bin\Debug).
샘플 코드는 다음과 같습니다 나는 코드가 잘하지만 오류의 원인이 뭐죠 내 컴퓨터의 출력 장치 인 것으로 추측하고있다
using System;
using Un4seen.Bass;
namespace MyFirstBass
{
class Program
{
static void Main(string[] args)
{
// init BASS using the default output device
if (Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero))
{
// create a stream channel from a file
int stream = Bass.BASS_StreamCreateFile("test.mp3", 0, 0, BASSFlag.BASS_DEFAULT);
if (stream != 0)
{
// play the stream channel
Bass.BASS_ChannelPlay(stream, false);
}
else
{
// error creating the stream
Console.WriteLine("Stream error: {0}", Bass.BASS_ErrorGetCode());
}
// wait for a key
Console.WriteLine("Press any key to exit");
Console.ReadKey(false);
// free the stream
Bass.BASS_StreamFree(stream);
// free BASS
Bass.BASS_Free();
}
}
}
}
.
응용 프로그램을 디버깅하려고 했습니까? 오류는 어디에서 발생합니까? 예외는 필요한 모든 DLL을 찾을 수 없기 때문에 .NET에서 형식을 만들 수 없다고 말합니다. 'bass.net.dll' 파일이'bass.dll'에 대한 래퍼 일 뿐이라면 프로그램을 작동시키기 위해서 두 dll이 모두 필요할 것입니다. –