Author Topic: One group of (HSTREAM HRECORD)  (Read 119 times)

SotirisPapad

  • Posts: 9
One group of (HSTREAM HRECORD)
« on: 12 Apr '17 - 22:17 »
I want to compound two or more streams (HSTREAM HRECORD) in one group and then play this group it on one othe  sound card outputs.
How can I make group of two or more streams ?
I am using delphi
Thank you.

Ian @ un4seen

  • Administrator
  • Posts: 19894
Re: One group of (HSTREAM HRECORD)
« Reply #1 on: 13 Apr '17 - 15:31 »
If you need the streams to be perfectly in sync with each other, then you could use the BASSmix add-on to achieve that. Something like this:

Code: [Select]
mixer=BASS_Mixer_StreamCreate(freq, chans, 0); // create a mixer
BASS_Mixer_StreamAddChannel(mixer, source1, 0); // plug in a source
BASS_Mixer_StreamAddChannel(mixer, source2, 0); // and another
BASS_ChannelPlay(mixer, 0); // start the mixer

Please see the BASSmix documentation for details. Note that the sources need to be "decoding channels", which means using the BASS_STREAM_DECODE flag (eg. in BASS_StreamCreateFile calls), or not using a RECORDPROC in BASS_RecordStart calls for recording channels.

SotirisPapad

  • Posts: 9
Re: One group of (HSTREAM HRECORD)
« Reply #2 on: 14 Apr '17 - 10:52 »
is working with big latency for record channel.
there is another way (Asio ?)

Ian @ un4seen

  • Administrator
  • Posts: 19894
Re: One group of (HSTREAM HRECORD)
« Reply #3 on: 14 Apr '17 - 16:29 »
Yes, you can reduce latenecy by using ASIO or WASAPI. In both cases, you would use a "push" stream (BASS_StreamCreate with STREAMPROC_PUSH) to forward the data from the input to the output; the push stream would be plugged into the mixer, and the input's ASIOPROC/WASAPIPROC function would call BASS_StreamPutData to pass the captured data to the push stream.

Before trying ASIO or WASAPI, another thing you could try is adding the BASS_MIXER_LIMIT flag to the recording's BASS_Mixer_StreamAddChannel call. Please see the BASS_Mixer_StreamAddChannel documentation for details.

SotirisPapad

  • Posts: 9
Re: One group of (HSTREAM HRECORD)
« Reply #4 on: 14 Apr '17 - 20:44 »
I am trying the example speakers  (delphi berlin) and i get error ''Can't start Asio Output"

SotirisPapad

  • Posts: 9
Re: One group of (HSTREAM HRECORD)
« Reply #5 on: 15 Apr '17 - 01:39 »
this function is working .
I can see the levels of source1 push stream.
I don't Hear sound
function MyAsioProc(input: boolean; Channel: DWORD; Buffer: Pointer; Length: DWORD; User: Pointer): DWORD; stdcall;
  {little reminder the "Channel: DWORD" in the Asio proc is the AsioChannel and not the Bass Channel Handle }
var
  c: DWORD;
begin
  c := BASS_StreamPutData(source1,buffer,length);
  if (c = -1) then c := 0;
  Result := c;
end;


level := BASS_ChannelGetLevel(source1);
RLedInL.Position := LoWord(Level);
RLedInR.Position := HiWord(Level);


« Last Edit: 15 Apr '17 - 02:02 by SotirisPapad »