0

我是 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);

但它仍然崩溃

4

1 回答 1

1

-functionBASS_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

API 文档: http ://www.un4seen.com/doc/#bass/BASS_Init.html

于 2013-02-06T16:32:49.570 回答