Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "bass.h"
- #include "bass_fx.h"
- int input;
- HRECORD rchan=0;
- static void CALLBACK get_beat_pos(DWORD chan, double beatpos, void *user)
- {
- printf("Beat Detected!");
- }
- BOOL CALLBACK RecordingCallback(HRECORD handle, const void *buffer, DWORD length, void *user)
- {
- //BASS_ChannelGetData(beatstream, buffer, length);
- printf("lol");
- return TRUE; // continue recording
- }
- void main()
- {
- /*BASS_DEVICEINFO di;
- printf("\nInput Devices\n");
- for (a=0;BASS_RecordGetDeviceInfo(a,&di);a++) {
- printf("%d: ",a);
- DisplayDeviceInfo(&di);
- }*/
- if (!BASS_Init(-1,44100,0,0,NULL))
- {
- printf("Can't initialize device");
- return;
- }
- int i;
- for (i=0;BASS_RecordSetInput(i,BASS_INPUT_OFF,-1);i++) ;
- BASS_RecordSetInput(input,BASS_INPUT_ON,-1);
- rchan=BASS_RecordStart(44100,2,0,&RecordingCallback,0);
- BASS_FX_BPM_BeatCallbackSet(rchan, &get_beat_pos, 0);
- while(1)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment