News:

SMF - Just Installed!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - djjoy

#1
I solve the error issue installing againd the waveformdisplay components.
With the code above, I can't see the waveform on the component area.

I need to do something else to display a basic waveform?

Thanks.
#2
I get this error:


  nResult := ActiveWaveformAnalyzer1.AnalyzeSoundFromFile(OpenDialog1.FileName);   --> nresult value is ever -100. 
#3
I have problems to start using waveformanalyzer. I try to convert VC example to delphi, but i can't ( at the moment).
Now, i want to start with easy things:

I want to start with a simple wave visualization with native render:


  Amp3dj1.InitDJSystem(1, Handle, 0, 0, 0, 0);  //init amp3dj
  Amp3dj1.MediaFileDecoder.Initialize();
  ActiveWaveformAnalyzer1.InitWaveformAnalyzer(form1.Handle);  //init waveformanalyzer


  //open a new song
  Amp3dj1.LoadSound(0, OpenDialog1.FileName);

  //open song in waveformanalyzer to render
  nResult := ActiveWaveformAnalyzer1.AnalyzeSoundFromFile(OpenDialog1.FileName);
  if (nResult <> 0) then
  begin
       showmessage('Ups... Error'');
  end;

  //Play song
  AMp3dj1.PlaySound(0);
  timer1.enabled := true;



procedure TForm1.Timer1Timer(Sender: TObject);
var
fCurrPositionInMs: double;
begin

Amp3dj1.SoundPositionGet (0, &fCurrPositionInMs, 0);

      // pass the current playback position to the waveform control so it will be able to update the waveform scroller
      // and the position of the playback line in real-time
    //   ActiveWaveformAnalyzer2.PlaybackPositionSet(round(fCurrPositionInMs));
      ActiveWaveformAnalyzer1.PlaybackPositionSet(round(fCurrPositionInMs));
end;



#4
Hi again Severino.
I'm trying with ActiveWaveformAnaƱyzer, but I have many problems in Delphi to set/get parameters like the VC6 or VB6 examples.
Do you have examples in Delphi to understand and work allright?

Waiting for your reply,

Best regards,

Jose Maria
#5
Hi again,

How can I make the reproduced wave part be displayed in one color,  and the one to be reproduced in another?
How can I paint in a different color a loop section?

Waiting for your reply,

Best Regards,

Jose Maria
#6
Hi severino again,

I'm trying to add a customdsp for send data to StreamQueuePushData. I don't know how to do this in delphi:
My idea is get data for each decks ( by custom dsp) and save it in a global var ( s1 and s2).
In the streamqueue, get data from s1 and s2.

I create callback for dsp:



var
m_idDspHeadInternal : integer;
m_idDspHeadInternal1 : integer;

s1:^extended; //buffer to head on player 0
l1: integer;   //length of buffer on player 0
s2:^extended; //buffer to head on player 1
l2: integer;   //length of buffer on player 1

procedure SetheadCallback(bufferSamples: pointer; bufferSamplesLength: DWORD; nUserData: DWORD);
     var
         a : Integer;
         r: olevariant;
begin
  //fill the buffer and get bufferlength
  s1 := bufferSamples;
  l1:=  bufferSamplesLength;
end;

procedure SetheadCallback1(bufferSamples: pointer; bufferSamplesLength: DWORD; nUserData: DWORD);
     var
         a : Integer;
         r: olevariant;
begin
  //fill the buffer and get bufferlength
  s2 := bufferSamples;
  l2:=  bufferSamplesLength;
end;


//on form create
procedure TForm1.FormCreate(Sender: TObject);
begin
Amp3dj1.CustomDSP.UseFloatSamples(BOOL_TRUE);
m_idDspHeadInternal := Amp3dj1.CustomDSP.InternalLoad(0);
m_idDspHeadInternal1 := Amp3dj1.CustomDSP.InternalLoad(1);
Amp3dj1.CustomDSP.InternalSetFunction(0, m_idDspHeadInternal,  SetheadCallback);  //<--Here is the problem.
Amp3dj1.CustomDSP.InternalSetFunction(1, m_idDspHeadInternal1, SetheadCallback1);  //<--Here is the problem.
//How can I call InternalSetFunction?? I get error Not Enough actual parameters.
// I try with @SetHeadCallback
// with ^SetHeadCallback
// with integer(SetHeadCallback)

Amp3dj1.CustomDSP.Enable(0,m_idDspHeadInternal, BOOL_TRUE,0,0);
Amp3dj1.CustomDSP.Enable(1,m_idDspHeadInterna1l, BOOL_TRUE,0,0);
//I create a streamQueue Player
Amp3dj1.StreamQueueCreate (2, 44100, 2, 16);  // I create the headphones channel on player 2
end;

//When streamqueue needs data, i fill it with the sum of headphones buffers
procedure TForm.Amp3dj1StreamQueueStalled(ASender: TObject; nPlayer: SmallInt);
var
  r: olevariant;
  a:integer;
begin
  r :=  varArrayCreate([0,L1],varSingle);
  for a := 0 to L1 -1 do
  begin
     r[a] := s1^ +  s2^;  // I have to divide by 2 ????
     inc(s1);
     inc(s2);

  end;

  amp3dj1.StreamQueuePushData(1, r, L1);

end;



Can you help me?

Best Regards,

Jose Maria
#7
Hi Severino...
Many thanks for your fast reply.

I will try your response.

DJ Joy.
#8
Thanks Severino for your reply.

I have another request.
Do you have examples for use active dj in delphi?
I would be so grateful.

Best Regards

(Sorry for my English... I'm Spanish)

DJ Joy
#9
Hi,
I'm testing your library. I need load one song. I want to play this song to 2 outputs. One to master(device 1)  and other to (device 2) headphones at the same time.
Can I do this?

Waiting for your reply,

Best Regards


DJ Joy