Forum > Audio and Video

[CLOSED] BASS Stream from resource

(1/1)

pcurtis:
How can I create a BASS stream from a resource without saving the resource to a file?

pcurtis:
procedure TForm1.FormCreate(Sender: TObject);
begin
  BASS_Init(-1, 44100, 0, Handle, nil);
  BASS_SetConfig(BASS_CONFIG_BUFFER, 5000);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  WavStream : TResourceStream;
begin
  WavStream := TResourceStream.Create(HINSTANCE, 'STOP', RT_RCDATA);
  strs := BASS_StreamCreateFile(True, WavStream.Memory, 0, WavStream.Size, 0);
  BASS_ChannelPlay(strs, False);
  WavStream.Free;
end;

Navigation

[0] Message Index

Go to full version