Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program BassFXTest;
- uses
- Vcl.Forms,
- Vcl.Dialogs,
- SysUtils,
- Variants,
- bass in 'Bass\bass.pas',
- bass_fx in 'Bass\bass_fx.pas';
- var
- Form : TForm;
- Channel : HChannel;
- Sample : HSample;
- Filename : PChar;
- Decoder, TempoStream : HStream;
- begin
- Application.Initialize;
- filename := PChar('pokeball_go.ogg');
- Application.MainFormOnTaskBar := true;
- Application.CreateForm(TForm, Form);
- if not Bass_Init(-1, 44000, 0, 0, nil) then
- ShowMessage('Error initing (' + IntToStr(Bass_ErrorGetCode) + ').');
- // Sample := Bass_SampleLoad(false, filename, 0, 0, 1000, BASS_UNICODE);
- // if Sample = 0 then
- // ShowMessage('Error loading sample (' + IntToStr(Bass_ErrorGetCode) + ').');
- // Channel := Bass_SampleGetChannel(Sample, false);
- // if Channel = 0 then
- // ShowMessage('Error creating Channel (' + IntToStr(Bass_ErrorGetCode) + ').');
- // if not BASS_ChannelSetAttribute(Channel, BASS_ATTRIB_VOL, 1) then
- // ShowMessage('Error VOL (' + IntToStr(Bass_ErrorGetCode) + ').');
- //if not BASS_ChannelSetAttribute(Channel, BASS_ATTRIB_TEMPO_PITCH, 3) then
- // ShowMessage('Error PITCH (' + IntToStr(Bass_ErrorGetCode) + ').');
- //if not BASS_ChannelPlay(Channel, True) then
- // ShowMessage('Error Playing Channel (' + IntToStr(Bass_ErrorGetCode) + ').');
- Decoder := BASS_StreamCreateFile(FALSE, filename, 0, 0, BASS_STREAM_DECODE OR BASS_UNICODE);
- if Decoder = 0 then
- ShowMessage('Error decoding (' + IntToStr(Bass_ErrorGetCode) + ').');
- TempoStream := BASS_FX_TempoCreate(Decoder, BASS_FX_FREESOURCE);
- if TempoStream = 0 then
- ShowMessage('Error streaming (' + IntToStr(Bass_ErrorGetCode) + ').');
- if not BASS_ChannelSetAttribute(tempostream, BASS_ATTRIB_TEMPO_PITCH, 3) then
- ShowMessage('Error PITCH (' + IntToStr(Bass_ErrorGetCode) + ').');
- if not BASS_ChannelPlay(TempoStream, True) then
- ShowMessage('Error Playing Channel (' + IntToStr(Bass_ErrorGetCode) + ').');
- Application.Run;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement