GAMELASTER

BASS BMP detection

Apr 20th, 2015
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #include <stdio.h>
  2. #include "bass.h"
  3. #include "bass_fx.h"
  4.  
  5. int input;
  6.  
  7. HRECORD rchan=0;
  8.  
  9. static void CALLBACK get_beat_pos(DWORD chan, double beatpos, void *user)
  10. {
  11.     printf("Beat Detected!");
  12. }
  13.  
  14. BOOL CALLBACK RecordingCallback(HRECORD handle, const void *buffer, DWORD length, void *user)
  15. {
  16.     //BASS_ChannelGetData(beatstream, buffer, length);
  17.     printf("lol");
  18.     return TRUE; // continue recording
  19. }
  20.  
  21. void main()
  22. {
  23.     /*BASS_DEVICEINFO di;
  24.     printf("\nInput Devices\n");
  25.     for (a=0;BASS_RecordGetDeviceInfo(a,&di);a++) {
  26.         printf("%d: ",a);
  27.         DisplayDeviceInfo(&di);
  28.     }*/
  29.     if (!BASS_Init(-1,44100,0,0,NULL))
  30.     {  
  31.         printf("Can't initialize device");
  32.         return;
  33.     }
  34.     int i;
  35.     for (i=0;BASS_RecordSetInput(i,BASS_INPUT_OFF,-1);i++) ;
  36.     BASS_RecordSetInput(input,BASS_INPUT_ON,-1);
  37.     rchan=BASS_RecordStart(44100,2,0,&RecordingCallback,0);
  38.     BASS_FX_BPM_BeatCallbackSet(rchan, &get_beat_pos, 0);
  39.    
  40.     while(1)
  41.     {
  42.    
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment