Author Topic: Delphi: How to save a BASS_Mixer channel to file whithout playback  (Read 1001 times)

francis57

  • Posts: 21
How can I save a channel to .wav whithout Bass_channel_play? My code is:

var
  encoder: HSTREAM;
begin
  Encoder:=BASS_Encode_Start(mixer, PChar(filename), BASS_UNICODE or BASS_ENCODE_PCM, nil, 0)  ;
  BASS_ChannelPlay(Mixer, false);
end;

It works fine, but the duration of mixer's sound is over 4 minutes and I'd like to save it with a progressbar in short time. Could anybody help me, please? Thanks in advance,

Herb

Ian @ un4seen

  • Administrator
  • Posts: 20426
You would need to make the mixer a "decoding channel" by using the BASS_STREAM_DECODE flag in the BASS_Mixer_StreamCreate call. You can then repeatedly call BASS_ChannelGetData to process it, instead of BASS_ChannelPlay. Here is some example Delphi code for that...

   www.un4seen.com/forum/?topic=12247

francis57

  • Posts: 21
O! Many thanks! Now it works perfectly! :)
Herb