Author Topic: Bass_FX su Delphi  (Read 88 times)

dilmar

  • Posts: 13
Bass_FX su Delphi
« on: 15 Feb '21 - 14:43 »
Hi Guys, bass_fx doesn't work, where am I wrong?
Showmessage(IntToStr(bass.bass_ErrorGetCode())); returns 5(BASS_ERROR_HANDLE)
Code: [Select]
var lunghezza:integer;
begin
if opendialog1.Execute then
begin
   Channel := BASS_StreamCreateFile(false, PCHAR(opendialog1.filename), 0, 0,bass.BASS_STREAM_DECODE);
   Tempo:=BASS_FX_TempoCreate(Channel, BASS_FX_FREESOURCE);
  lunghezza:=bass.BASS_ChannelGetLength(Channel,BASS_POS_BYTE);
   Bass.BASS_ChannelSetAttribute(Tempo, bass_Fx.BASS_ATTRIB_TEMPO_PITCH , -5);
  BASS_ChannelPlay(Tempo, false);
Showmessage(IntToStr(bass.bass_ErrorGetCode()));
end;
« Last Edit: 15 Feb '21 - 15:05 by dilmar »

Ian @ un4seen

  • Administrator
  • Posts: 23404
Re: Bass_FX su Delphi
« Reply #1 on: 15 Feb '21 - 16:48 »
BASS_ERROR_HANDLE means an earlier BASS function call failed. Please check the error code after every call, to find out which one is failing first.

dilmar

  • Posts: 13
Re: Bass_FX su Delphi
« Reply #2 on: 15 Feb '21 - 17:08 »
Code: [Select]
Channel := BASS_StreamCreateFile(false, PCHAR(opendialog1.filename), 0, 0,bass.BASS_STREAM_DECODE);
Showmessage(IntToStr(bass.bass_ErrorGetCode()));
reusult 2(BASS_ERROR_FILEOPEN)
I get this error if I set the flag BASS_STREAM_DECODE, while if I set the flag of the BASS_StreamCreateFile function to BASS_UNICODE I don't get an error but then I can't create instance "Tempo"


later

Code: [Select]
Tempo:=BASS_FX_TempoCreate(Channel, BASS_FX_FREESOURCE);
   Showmessage(IntToStr(bass.bass_ErrorGetCode()));
results 5 (BASS_ERROR_HANDLE)
I have consulted the guide but I can not solve it, everything seems ok

Ian @ un4seen

  • Administrator
  • Posts: 23404
Re: Bass_FX su Delphi
« Reply #3 on: 15 Feb '21 - 17:42 »
You can combine the BASS_STREAM_DECODE and BASS_UNICODE flags, like this:

Code: [Select]
Channel := BASS_StreamCreateFile(false, PCHAR(opendialog1.filename), 0, 0, BASS_STREAM_DECODE or BASS_UNICODE);

dilmar

  • Posts: 13
Re: Bass_FX su Delphi
« Reply #4 on: 15 Feb '21 - 18:33 »
Perfect thanks, I solved.
To close the pointers?