Bass.dll Работа со звуком
Подскажите где косяк в коде?
Постоянно выдает ошибку.
Код:
format PE GUI 4.0
entry start
include 'win32a.inc'
include 'const.inc'
section '.text' code readable executable
start:
xor eax,eax
invoke BASS_GetVersion
cmp eax,0x02040600 ;Наша версия?
je @f
invoke MessageBox,0,HDDf,HDDs,0
@@:
invoke BASS_Init,-1,22050,BASS_DEVICE_3D,0,0
cmp eax,1
je @f
invoke MessageBox,0,HDDe,HDDs,0
@@:
invoke BASS_SampleLoad,0,FileName,0,0,1,BASS_SAMPLE_3D+BASS_SAMPLE_LOOP ; (FALSE,filename, 0, 0,1, BASS_SAMPLE_3D | BASS_SAMPLE_LOOP )
cmp eax,0
je .error
mov [HSAMPLE],eax
invoke BASS_SampleGetChannel,[HSAMPLE],0 ;(samp,FALSE)
cmp eax,0
je .error
mov [HCHANNEL],eax
invoke BASS_ChannelPlay,[HCHANNEL],0
cmp eax,0
je .error
jmp .exit
.error:
invoke MessageBox,0,HDDd,HDDs,0
.exit:
invoke ExitProcess,0
section '.data' data readable writeable
HDDs db 'BASS.dll',0
HDDf db 'Неверная версия Bass.dll',0
HDDe db 'Не удалось инициализировать BASS.dll',0
HDDd db 'Ошибка',0
FileName db 'test.mp3',0
HSAMPLE dd 0; /*дескриптор сэмпла */
HCHANNEL dd 0; /* дескриптор канала */
section '.idata' import data readable writeable
library bass,'BASS.DLL',\
kernel,'KERNEL32.DLL',\
user,'USER32.DLL'
import bass,\
BASS_GetVersion,'BASS_GetVersion',\
BASS_Init,'BASS_Init',\
BASS_SampleLoad,'BASS_SampleLoad',\
BASS_SampleGetChannel,'BASS_SampleGetChannel',\
BASS_ChannelPlay,'BASS_ChannelPlay'
import kernel,\
ExitProcess,'ExitProcess'
import user,\
MessageBox,'MessageBoxA'
entry start
include 'win32a.inc'
include 'const.inc'
section '.text' code readable executable
start:
xor eax,eax
invoke BASS_GetVersion
cmp eax,0x02040600 ;Наша версия?
je @f
invoke MessageBox,0,HDDf,HDDs,0
@@:
invoke BASS_Init,-1,22050,BASS_DEVICE_3D,0,0
cmp eax,1
je @f
invoke MessageBox,0,HDDe,HDDs,0
@@:
invoke BASS_SampleLoad,0,FileName,0,0,1,BASS_SAMPLE_3D+BASS_SAMPLE_LOOP ; (FALSE,filename, 0, 0,1, BASS_SAMPLE_3D | BASS_SAMPLE_LOOP )
cmp eax,0
je .error
mov [HSAMPLE],eax
invoke BASS_SampleGetChannel,[HSAMPLE],0 ;(samp,FALSE)
cmp eax,0
je .error
mov [HCHANNEL],eax
invoke BASS_ChannelPlay,[HCHANNEL],0
cmp eax,0
je .error
jmp .exit
.error:
invoke MessageBox,0,HDDd,HDDs,0
.exit:
invoke ExitProcess,0
section '.data' data readable writeable
HDDs db 'BASS.dll',0
HDDf db 'Неверная версия Bass.dll',0
HDDe db 'Не удалось инициализировать BASS.dll',0
HDDd db 'Ошибка',0
FileName db 'test.mp3',0
HSAMPLE dd 0; /*дескриптор сэмпла */
HCHANNEL dd 0; /* дескриптор канала */
section '.idata' import data readable writeable
library bass,'BASS.DLL',\
kernel,'KERNEL32.DLL',\
user,'USER32.DLL'
import bass,\
BASS_GetVersion,'BASS_GetVersion',\
BASS_Init,'BASS_Init',\
BASS_SampleLoad,'BASS_SampleLoad',\
BASS_SampleGetChannel,'BASS_SampleGetChannel',\
BASS_ChannelPlay,'BASS_ChannelPlay'
import kernel,\
ExitProcess,'ExitProcess'
import user,\
MessageBox,'MessageBoxA'