21 May '13 - 06:35 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: ChannelSlideAttribute to get volume peak  (Read 271 times)
Guido
Posts: 17


« on: 13 Mar '12 - 13:51 »
Reply with quoteQuote

hi i've this code to get information about song as spectrum and wave data :

procedure TfrmMain.TimerTimer(Sender: TObject);
Var FFTData:TFFTData;
  VolPeak:Single;
begin
  tbSong.Position:=Round(BASS_ChannelBytes2Seconds(Channel1, BASS_ChannelGetPosition(Channel1, BASS_POS_BYTE)));

  // Spectrum animation
  BASS_ChannelGetData(Channel1, @FFTData, BASS_DATA_FFT1024);
  Spectrum.Draw(PaintFrame.Canvas.Handle, FFTData, 100, 0);

  // Loading wave view
  If BpP = 0 Then
    Exit;
  DrawWaveView(); // draw peak waveform
  DrawTime_Line(Loop[0],12,TColor($FFFF00)); // loop start
  DrawTime_Line(Loop[1],24,TColor($00FFFF)); // loop end

  BASS_ChannelSlideAttribute(Channel1,BASS_ATTRIB_VOL,VolPeak,tbSong.Position);

  DrawTime_Line(BASS_ChannelGetPosition(Channel1,BASS_POS_BYTE),
                0,TColor($FFFFFF), Round(VolPeak)); // current pos
  pbWave.Refresh();
end;

----------------

Now i need to retrieve the peak volume for a song using BASS_ChannelSlideAttribute but does'nt go fine. I reveice always 1,
but i need a peak while song scroll ....

I hope understand :-)

Thank u BYE
Logged
Ian @ un4seen
Administrator
Posts: 15253


« Reply #1 on: 13 Mar '12 - 15:15 »
Reply with quoteQuote

If I understand correctly, I think BASS_ChannelGetLevel is what you want.

Note the BASS_ATTRIB_VOL attribute is a volume level control, eg. you might tie it to a slider, but it won't tell you about the level of the sample data. BASS_ChannelGetAttribute will just give back what has previously been set via BASS_ChannelSetAttribute or BASS_ChannelSlideAttribute.
Logged
Guido
Posts: 17


« Reply #2 on: 13 Mar '12 - 18:09 »
Reply with quoteQuote

Thank u very much Ian GO FINE :-)
BYE
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines