Here is my code to use WASAPI, enjoy

//Initializing default output device on FormCreate
var
i, devcount: byte;
WASAPIDevInfo: BASS_WASAPI_DEVICEINFO;
music: hstream;
begin
for i := 0 to devcount do
begin
if not BASS_WASAPI_GetDeviceInfo(i, WASAPIDevInfo) then
break;
if ((WASAPIDevInfo.flags and BASS_DEVICE_DEFAULT) = (BASS_DEVICE_DEFAULT))
and ((WASAPIDevInfo.flags and BASS_DEVICE_INPUT) <> BASS_DEVICE_INPUT)
and (WASAPIDevInfo.flags and BASS_DEVICE_ENABLED =
BASS_DEVICE_ENABLED) then
break
else
Inc(devcount);
end;
BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 0);
if not BASS_Init(0, WASAPIDevInfo.mixfreq, 0, 0, nil) then
Showmessage('Error initializing DS audio!');
if not BASS_WASAPI_Init(i, WASAPIDevInfo.mixfreq, WASAPIDevInfo.mixchans,
BASS_WASAPI_BUFFER, 0, 0, @WasapiProc, nil) then
Showmessage('Error initializing WASAPI!');
end;
end;
//callback function
function WasapiProc(buffer: pointer; length: dword; user: pointer): dword;
stdcall;
var
c: dword;
begin
c := Bass_ChannelGetData(music, buffer, length);
if (c = -1) then
c := 0;
Result := c;
end;
//opening and playing file
Music := Bass_StreamCreateFile(false, PChar('C:\test.wav'), 0, 0,
BASS_SAMPLE_FLOAT or BASS_STREAM_DECODE or BASS_UNICODE);
if not BASS_WASAPI_Start then
Showmessage('Error Playing File');