|
Hi all,
I've been trying to use uos with Lazarus (1.8.0-rc4 on linux64).
What I want to: listen to MIC and show level
my code:
uos_CreatePlayer( 0 );
InputIndex1 := uos_AddFromDevIn( 0 ); // Input from IN Device
writeln('InputIndex1 : ' + inttostr(inputIndex1));
uos_AddIntoFile( 0, 'waveform-record.wav' ); // Output into OUT Device
uos_InputSetLevelEnable(0,InputIndex1,1);
uos_InputAddDSP1ChanTo2Chan(0,InputIndex1);
uos_InputAddDSPVolume(0,InputIndex1, 1, 1);
DSPIndex:= uos_InputAddDSP (0,0,@DSPfs,nil,nil,nil);
uos_InputSetDSP(0, InputIndex1, DSPIndex, true);
uos_AddIntoDevOut(0);
uos_LoopEndProc(0,@InLoopMem);
uos_EndProc(0, @ClosePlayer1);
uos_Play(0); // Listen your mic with DSP effects...
where
procedure TForm1.InLoopMem;
begin
label4.caption:= timetostr(now()) + ' Level = ' + floattostr(uos_InputGetLevelLeft(0,InputIndex1));
// label4.caption:= timetostr(now()) + ' Size = ' + floattostr(length(waveformdata));
writeln(timetostr(now()) + ' inLoop. InputIndex1=' + floattostr(InputIndex1));
end;
and
function DSPfs(var Data: TuosF_Data; var fft: TuosF_FFT): TDArFloat ;
begin
writeln('Input #chan : ' + floattostr(data.Channels));
writeln('Input #LevelEnable: ' + floattostr(data.LevelEnable));
writeln('Input #TYPE : ' + floattostr(data.TypePut));
writeln('Input #posmem: ' + floattostr(data.posmem ));
writeln('Input Position: ' + floattostr(data.));
end;
But: I can't find values of the incoming sound. Where do I have to look for it?
I have attached some code (modified example waveform.lpi, I added a "REC" Botton)
Maybe you can push me into the right direction :-)
|