UOS is to complex, and PXL does not seem to support it.
C00L, can you please send them up to woutervanwegen@gmail.com ? Great thanks in advance!
May I ask you what is to complex with uos and what is PXL?
May I ask you what is to complex with uos and what is PXL?
Platform eXtended Library (https://asphyre.net/products/pxl)
program WVW_PULSE; {$mode objfpc}{$H+} uses {$IFDEF UNIX} cthreads, {$ENDIF} Classes, SysUtils, CustApp, pulse_simple, pulse_sample, ctypes, pulse_def, crt; { you can add units after this } type { TMyApplication } TMyApplication = class(TCustomApplication) protected procedure DoRun; override; public pulse: PPASimple; ss: TPASampleSpec; err: cint; buf: array[0..Pred(4096)] of Byte; i : integer; constructor Create(TheOwner: TComponent); override; destructor Destroy; override; procedure WriteHelp; virtual; end; { TMyApplication } procedure TMyApplication.DoRun; var ErrorMsg: String; X : integer; begin // quick check parameters ErrorMsg:=CheckOptions('h', 'help'); if ErrorMsg<>'' then begin ShowException(Exception.Create(ErrorMsg)); Terminate; Exit; end; // parse parameters if HasOption('h', 'help') then begin WriteHelp; Terminate; Exit; end; { add your program here } ss.Init; ss.Format := sfFloat32LE; ss.Rate := 44100; ss.Channels := 1; pulse := TPASimple.New(Nil, 'WvW pulseaudio Client', sdRECORD, Nil, 'WvW Qualizer!', @ss, Nil, Nil, @err); if not Assigned(pulse) then begin Writeln('Failed to connect to PulseAudio server; error: ', err); Halt(1); end; Writeln('WVW Server Connected'); repeat inc(i); if i = 1000 then i:=1; if pulse^.Read(@buf[0], Length(buf), Nil) < 0 then Continue; Write('WVW '+IntToStr(i)+' '); write(buf[0]); for X:=1 to Length(buf) do write(buf[X]); delay(155); until keypressed; pulse^.Free; // stop program loop Terminate; end; constructor TMyApplication.Create(TheOwner: TComponent); begin inherited Create(TheOwner); StopOnException:=True; end; destructor TMyApplication.Destroy; begin inherited Destroy; end; procedure TMyApplication.WriteHelp; begin { add your help code here } writeln('Usage: ', ExeName, ' -h'); end; var Application: TMyApplication; begin Application:=TMyApplication.Create(nil); Application.Title:='My Application'; Application.Run; Application.Free; end.
Can you please also help debugging this?
So... if i work very long on this piece of source code then i will end up having a graphic equalizer ? or can you supply me with more code/help?
Screenshot so far attached !
code now using:
program WVW_PULSE; {$mode objfpc}{$H+} uses {$IFDEF UNIX} cthreads, {$ENDIF} Classes, SysUtils, CustApp, pulse_simple, pulse_sample, ctypes, pulse_def, crt; { you can add units after this } type { TMyApplication } TMyApplication = class(TCustomApplication) protected procedure DoRun; override; public pulse: PPASimple; ss: TPASampleSpec; err: cint; buf: array[0..Pred(4096)] of Byte; i : integer; constructor Create(TheOwner: TComponent); override; destructor Destroy; override; procedure WriteHelp; virtual; end; { TMyApplication } procedure TMyApplication.DoRun; var ErrorMsg: String; X : integer; begin // quick check parameters ErrorMsg:=CheckOptions('h', 'help'); if ErrorMsg<>'' then begin ShowException(Exception.Create(ErrorMsg)); Terminate; Exit; end; // parse parameters if HasOption('h', 'help') then begin WriteHelp; Terminate; Exit; end; { add your program here } ss.Init; ss.Format := sfFloat32LE; ss.Rate := 44100; ss.Channels := 1; pulse := TPASimple.New(Nil, 'WvW pulseaudio Client', sdRECORD, Nil, 'WvW Qualizer!', @ss, Nil, Nil, @err); if not Assigned(pulse) then begin Writeln('Failed to connect to PulseAudio server; error: ', err); Halt(1); end; Writeln('WVW Server Connected'); repeat inc(i); if i = 1000 then i:=1; if pulse^.Read(@buf[0], Length(buf), Nil) < 0 then Continue; Write('WVW '+IntToStr(i)+' '); writeln('****************************************************************'); for X:=1 to high(buf) do write(IntToStr(x) + ' = ' + IntToStr(buf[X]) + ' '); writeln('****************************************************************'); delay(155); until keypressed; pulse^.Free; // stop program loop Terminate; end; constructor TMyApplication.Create(TheOwner: TComponent); begin inherited Create(TheOwner); StopOnException:=True; end; destructor TMyApplication.Destroy; begin inherited Destroy; end; procedure TMyApplication.WriteHelp; begin { add your help code here } writeln('Usage: ', ExeName, ' -h'); end; var Application: TMyApplication; begin Application:=TMyApplication.Create(nil); Application.Title:='My Application'; Application.Run; Application.Free; end.
i will end up having a graphic equalizer
buf: array[0..Pred(4096)] of Byte; .... ss.Format := sfFloat32LE; ... for X:=1 to high(buf) do write(IntToStr(x) + ' = ' + IntToStr(buf[X]) + ' ');
Can you please send me up the FPC code for the Panneau Dock 1 ? Greetz, Wouter.
That will be great help.!
In uos demos there is a uos simple console app to show spectrum:
https://github.com/fredvs/uos/blob/main/examples/consolespectrum.pas
// Spectrum : create bandpass filters with alsobuf set to false, how many you want:
uos_InputAddFilter(PlayerIndex1, InputIndex1, -1, 10000,20000, 1, -1, 10000,20000, 1, false, nil); uos_InputAddFilter(PlayerIndex1, InputIndex1, -1, 6000, 10000, 5, -1, 6000, 10000, 5, false, nil); uos_InputAddFilter(PlayerIndex1, InputIndex1, -1, 4000, 6000, 5, -1, 4000, 6000, 5, false, nil); uos_InputAddFilter(PlayerIndex1, InputIndex1, -1, 2500, 4000, 5, -1, 2500, 4000, 5, false, nil); uos_InputAddFilter(PlayerIndex1, InputIndex1, -1, 1000, 2500, 5, -1, 1000, 2500, 5, false, nil); uos_InputAddFilter(PlayerIndex1, InputIndex1, -1, 700, 1000, 5, -1, 700, 1000, 5, false, nil); uos_InputAddFilter(PlayerIndex1, InputIndex1, -1, 500, 700, 5, -1, 500, 700, 5, false, nil); uos_InputAddFilter(PlayerIndex1, InputIndex1, -1, 300, 500, 5, -1, 300, 500, 5, false, nil);
And did i give the right paramaters for uos_InputAddFilter, like above ? Grtz W