22 May '13 - 01:10 *
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: Popping sound  (Read 702 times)
ELCouz
Guest
« on: 18 Apr '10 - 01:15 »
Reply with quoteQuote

Hi,

I'm new to bass and i think it's the most useful and simple lib to use  Smiley

BUT when making a test player in delphi at the end of channel play i hear a popping sound.

What can i do to eliminate this (tried autofree flag, bigger buffer length flag nothing worked)?

Here's my very simple code:

load button
procedure TForm1.loadbtnClick(Sender: TObject);
begin
BASS_Init(-1, 44100, 0, 0, nil);
chn := BASS_StreamCreateFile(FALSE, pansichar('s.mp3'), 0, 0, BASS_STREAM_PRESCAN);
statusgauge.MaxValue := BASS_ChannelGetLength(chn,BASS_POS_BYTE);
end;

play/pause button

procedure TForm1.playbtnClick(Sender: TObject);
begin
if playbtn.Tag = 0 then
begin
playbtn.Imageindex := 2;
BASS_ChannelPlay(chn, False);
playbtn.Tag := 1;
end else
begin
playbtn.Imageindex := 0;
BASS_ChannelPause(chn);
playbtn.Tag := 0;
end;
end;

stop button:

procedure TForm1.stopbtnClick(Sender: TObject);
begin
BASS_ChannelStop(chn);
BASS_ChannelSetPosition(chn,0,BASS_POS_BYTE);
playbtn.Imageindex := 0;
playbtn.Tag := 0;
end;

and the last... timer for updating the progress bar

procedure TForm1.infoupdtimerTimer(Sender: TObject);
begin
if chn <> 0 then begin
statusgauge.Progress := BASS_ChannelGetPosition(chn, 0)
//BASS_ChannelBytes2Seconds(chn, BASS_ChannelGetPosition(chn, 0));
end;


At the end of file it's always popping but if i do play/pause or stop it's okay and very smooth.

Regards,
Laurent
Logged
ELCouz
Guest
« Reply #1 on: 18 Apr '10 - 02:57 »
Reply with quoteQuote

OMG i feel so stupid for loosing so much time finding this bug ... that in fact was the test mp3 contains a pop at the end

Tried with another file and it work like a charm !

Nevermind this topic and bass is the best!

Best Regards,
Laurent
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines