Yes, no problems. ASIO and WASAPI output OK.
32/176.4
WAVE VS WavPak
Size 420MB vs 280MB
CPU LOAD over vs 98%
WAVE loading process is very slow. I want to more quick loading FLOAT WAVE files.
and ... I change output foramt WavPak. I use "wavpackdll.dll". BASS lib slow Wave
Loading process. WavPak lib fast loading process. only 0.5...1.0 sec waiting time,
however Realtime processing critical waiting time.
The quality of tone quality is really a little. However, I am embarrassed because
I understand plainly when becoming the environment of high-end.
File output code
DataSection
Wave32header:
Data.b $52,$49,$46,$46 ; RIFF : 0 :4
Data.b 0,0,0,0 ; Size - 8 : 4 : 8
Data.b $57,$41,$56,$45,$66,$6D,$74,$20 ; WAVEfmt : 8 : 16
Data.b $10,$00,$00,$00 ; PCM : 16 : 20
Data.b $03,$00 ; Float32 : 20 : 22
Data.b $02,$00 ; Streo 2ch : 22 : 24
Data.b 0,0,0,0 ; Format : 24 : 28
Data.b 0,0,0,0 ; Speed : 28 : 32
Data.b 0,0 ; BlockSize Byte/SamplexCh : 32 : 34
Data.b 0,0 ; Bit : 34 : 36
Data.b $64,$61,$74,$61 ; Data : 36 : 40
Data.b 0,0,0,0,0,0 ; Raw Size : 40 : 44
Data.b 0,0,0,0,0,0 ; Raw Size : 40 : 44
EndDataSection
Global callFile = CreateFile(#PB_Any, "C:\test_chk.wav")
Filename.s = OpenFileRequester("TEST", "*.*", "*.*;*.*", 0)
BASS_Init(0, 44100,0,0,#Null)
chan = BASS_FLAC_StreamCreateFile(#False, @Filename, 0, 0, #BASS_STREAM_DECODE | #BASS_SAMPLE_FLOAT | #BASS_STREAM_PRESCAN)
start =1
pos.q = BASS_ChannelGetLength(chan,#BASS_POS_BYTE)
CopyMemory(?Wave32header, *out2, 44)
PokeL(*out2+24, 176400) ; Format
PokeL(*out2+28, 176400*8) ; Speed
PokeW(*out2+32, 8) ; BlockSize
PokeW(*out2+34, 32) ; Bit
PokeL(*out2+4, pos*2*4+44-8) ; Size - 8
PokeL(*out2+40, pos*2*4)
WriteData(callFile, *out2, 44)
....
WriteData(callFile, *out2+44, posSinc)
;
Until Endpos=2
CloseFile(callFile)
MessageRequester("Finish", "")
Play output code for BASSmix
pos.q = BASS_ChannelGetLength(chan,#BASS_POS_BYTE)
Pos2.q = BASS_ChannelGetPosition(chan,#BASS_POS_BYTE)
CopyMemory(?Wave32header, *out2, 44)
PokeL(*out2+24, freq) ; Format
PokeL(*out2+28, freq*8) ; Speed
PokeW(*out2+32, 8) ; BlockSize
PokeW(*out2+34, 32) ; Bit
If (pos-Pos2)<=#BUF1
pdiv = pos-Pos2
Bass_ChannelGetData(chan, *out2+44, pdiv)
NextPlaysongs()
If chan<>0
pos=BASS_ChannelGetLength(chan,#BASS_POS_BYTE)
If pos>(#BUF1-pdiv)
Bass_ChannelGetData(chan, *out2+44+pdiv, #BUF1-pdiv)
pdiv=#BUF1
EndIf
Else
LockMutex(Mutex) :Endpos=2 : UnlockMutex(Mutex)
EndIf
Else
pdiv = #BUF1
Bass_ChannelGetData(chan, *out2+44, pdiv)
EndIf
PokeL(*out2+4, pdiv+44-8);+44) ; Size - 8
PokeL(*out2+40, pdiv)
LockMutex(Mutex)
Select ch
Case 1
BASS_StreamFree(chan2)
CopyMemory(*out2, *out_2, pdiv+44)
chan2 = BASS_StreamCreateFile(#True, *out_2, 0, pdiv+44, #BASS_STREAM_DECODE|#BASS_SAMPLE_FLOAT | #BASS_STREAM_PRESCAN)
NowChan = chan2 : chan4 = chan2
Case 2
BASS_StreamFree(chan3)
CopyMemory(*out2, *out_1, pdiv+44)
chan3 = BASS_StreamCreateFile(#True, *out_1, 0, pdiv+44, #BASS_STREAM_DECODE|#BASS_SAMPLE_FLOAT | #BASS_STREAM_PRESCAN)
NowChan = chan3 : chan4 = chan3
EndSelect
ready=pdiv
UnlockMutex(Mutex)
ASIO Proc by BASSmix
Procedure.l AsioProc(input.b, channel.l, *buffer, length.l, *user)
;http://www.un4seen.com/forum/?topic=11261.0
Shared mixer.l, chan4.l, chan3.l, chan2.l, Endpos.b
Protected *b=*buffer
Protected done.l = 0
Protected C.l, c2.l
C.l = BASS_ChannelGetData(mixer, *b+done, length-done); // get some data from the source
If C=-1
C=0
EndIf
done+C
If done=length; // got the wanted amount of data
C=length
ElseIf chan4
BASS_Mixer_StreamAddChannel(mixer, chan4, #BASS_MIXER_NORAMPIN)
BASS_ChannelSetPosition(mixer, 0, #BASS_POS_BYTE)
c2.l = BASS_ChannelGetData(mixer, *b+done, length-done); // get some data from the source
If c2=-1
c2=0
EndIf
C+c2
If chan4=chan2 And Endpos=1
chan4=chan3
ElseIf chan4=chan3 And Endpos=1
chan4=chan2
Else
chan4=0
EndIf
EndIf
ProcedureReturn C
EndProcedure