BASS, ASIO / WASAPI. Music player

Share your advanced PureBasic knowledge/code with the community.
User avatar
oryaaaaa
Addict
Addict
Posts: 825
Joined: Mon Jan 12, 2004 11:40 pm
Location: Okazaki, JAPAN

BASS, ASIO / WASAPI. Music player

Post by oryaaaaa »

This code used un4seen BASS Library. ASIO and WASAPI 32bit Float outputs.
You can write audio processing by 32bit float.

Code: Select all

Procedure.l UpSamplingThread(dummy.l)
  Shared EndThread.b, chan4.l, Endpos.b, pdiv.l, Freq.l, ready.l, chan.l, ch.b
  Protected posSinc.l, NowChan.l, start.b, posSinc2.l
  start = 0 : EndThread = 0
  Repeat
    Delay(100)
    If EndThread
      ProcedureReturn
    EndIf 
    ;
    If (start=0 Or start=1 Or NowChan<>chan4) And Freq>0 And chan<>0 And Endpos=1
      If start=0
      ElseIf ch=2
        ch=1
      Else
        ch=2
      EndIf
      Select start
        Case 0,1
          start+1
      EndSelect
      ;
      Get_Buffer(start)
      ;
      ; #### Sound Processing IN *in Size pdiv , OUT *out6 Size porSinc #####
      ; L 4byte float, R 4byte float, L 4byte float, R 4byte float, ...
      posSinc = pdiv
      CopyMemory(*in, *out6, posSinc)
      ; L 4byte float, R 4byte float, L 4byte float, R 4byte float, ...
      ; #### Sound Processing IN *in Size pdiv , OUT *out6 Size porSinc #####
      ; 
      
      Select ch 
        Case 1
          CopyMemory(*out6, *out_2, posSinc)
          NowChan = #chan2 : out_2s = posSinc : out_2p = 0
          ready=posSinc
        Case 2
          CopyMemory(*out6, *out_1, posSinc)
          NowChan = #chan3 : out_1s = posSinc : out_1p = 0
          ready=posSinc
      EndSelect
      
    EndIf
  Until Endpos>=2
EndProcedure

Bug head green 1.26 Open source
bughead_green.zip [485.41 KiB]
http://oryaaaaa.world.coocan.jp/_userda ... d_green.7z

Removed audio processing codes
commented by Japanese
Include binary and DLL
include LIB files