我是 Bass 的初学者(现在正在从事 MFC 项目),我正在尝试解决这个问题。
我发现应该从 BASS_Init
函数开始,但我找到了两个示例,一个有 4 个参数,另一个有 6 个参数。
当我尝试使用该函数时,它只提供一个没有重载的 5 参数版本,当我尝试使用它时,我的应用程序崩溃了。有没有在 MFC 上使用 BASS 的好例子可供我学习?或者在哪里可以找到 API 的文档?
该行是:
BASS_Init(-1,44100,0,this->m_hWnd,NULL);
我已经尝试过:
BASS_Init(-1,44100,0,GetSafeHwnd(),NULL);
但还是崩溃
最佳答案
BASS_Init()
函数采用 5 参数:
BOOL BASS_Init(
int device, // The device to use... -1 = default device, 0 = no sound, 1 = first real output device
DWORD freq, // Output sample rate
DWORD flags, // A combination of flags
HWND win, // The application's main window... 0 = the current foreground window (use this for console applications)
GUID *clsid // Class identifier of the object to create, that will be used to initialize DirectSound... NULL = use default
);
示例:
int device = -1; // Default device
int freq = 44100; // Sample rate
BASS_Init(device, freq, 0, 0, NULL); // Init BASS
关于谁能告诉我这有什么问题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3267678/