hello im beginner programmer. and im not good at english... really... so please understand me.
language: c#
i want recording with mic. and get frequency data. mic is on the notebook computer.
so my code is:
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero));
if (!Bass.BASS_RecordInit(-1)) {
Console.WriteLine("Can't initialize device");
return;
}
int handle = Bass.BASS_RecordStart(44100, 2, BASSFlag.BASS_RECORD_PAUSE, null, IntPtr.Zero);
Bass.BASS_ChannelPlay(handle, false);
float[] fft = new float[512];
Bass.BASS_ChannelGetData(handle, fft, (int)BASSDATA.Bass_DATA_FFT1024));
q1:
i guess data is stored fft array. with only this code. so
for (int i = 0; i < fft.length; ++i) {
console.writeline(fft [i]);
}
but fft's every element is 0. maybe there are problems... T.T
q2:
i think record is running on thread.. but this program is terminated in 1 second.
when recording? i think record takes time. but this program is immediately terminated.
q3:
if data is stored, i don't understand data's meaning.
what is array's index? and value?
and BASSDATA.Bass_DATA_FFT1024 -> what is 1024? i want mic input -> fft -> make score
what number i have to use?
g4:
Bass.BASS_ChannelGetData function is called 1 per music. -> right?
--------------
i read api document... with my not good english skill.
and Bass.BASS_ErrorGetCode result is all BASS_OK
and windows inner program <recorder> is well excuted.
please help me. im beginner. so detail explanation please. thank you~