Bass23

Blitz3D Forums/Blitz3D Userlibs/Bass23

@ kingclong2
Can you show how you call the function (code), what os do you have?
Try also BASS_RecordStart%(freq%,chans%,flags%,proc%,user%) : "BASS_RecordStart"
So : BASS_RecordStart(freq,chans,flags,0,0)

Update 1.3.2 for chiptune freaks ^^ new function added BASS_MakeBeep.
See demo_beep.bb


Function BASS_CreateBeep%(art% = 1 ,hz% = 900,time% = 100 ,freq% = 44100 , chans% = 1, max% = 1, flags% = 0, onlynew% = 0)

Local q%, y%, yy% , stemp%, length%, tbank%, hfinal%, hchannel%
length = (((freq*chans)*time) / 1000)*2

stemp = BASS_SampleCreate(length,freq,chans,max,flags)
If stemp = 0 Then RuntimeError "Stemp"
tbank = CreateBank (length*2)

For q = 0 To (length-1)
;this 4 are for 44100/mono/16bit (default values)
If art=1 y=Sin(q/44100.0*360*hz)*32767
If art=2 yy=yy+Rand(hz/8,hz*3):y=Sin(yy/44100.0*360)*16384
If art=3 yy=yy+Rand(1000.0*hz/(q+1),1000.0*hz/(q+1)*10):y=Sin(yy/44100.0*360)*16384
If art=4 y=y+hz*1.45:If y>32767 y=-32767

;feel free to add your one stuff. :)

PokeShort tbank, q*2, y
Next
BASS_RtlMoveMemory2(stemp, tbank, length)
FreeBank tbank
hfinal = BASS_SampleCreateDone()
hchannel = BASS_SampleGetChannel (hfinal, onlynew)
Return hchannel

End Function



Have fun with this. ;)