Author Topic: BASS MIXER Without SoundCard  (Read 1634 times)

Kmaa

  • Posts: 21
BASS MIXER Without SoundCard
« on: 7 Aug '11 - 12:36 »
Hy,

I Have a litle problem when Y user BassMixer with Bass Init(0)


Code: [Select]

int AUDIO_SOUDCARD = 0
int AUDIO_SAMPLERATE = 44100

// BASS INIT
Bass.BASS_Init(AUDIO_SOUNDCARD, AUDIO_SAMPLERATE, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);


// MIXER INIT
if (AUDIO_CARDNUMBER != 0)
       _mixerStream = BassMix.BASS_Mixer_StreamCreate(AUDIO_SAMPLERATE, AUDIO_CHANNEL, BASSFlag.BASS_STREAM_PRESCAN);
else
       _mixerStream = BassMix.BASS_Mixer_StreamCreate(AUDIO_SAMPLERATE, AUDIO_CHANNEL, BASSFlag.BASS_STREAM_DECODE);


// STREAM PLAY
_Stream = Bass.BASS_StreamCreateURL(streamURL, 0, BASSFlag.BASS_STREAM_DECODE, null, IntPtr.Zero);
BassMix.BASS_Mixer_StreamAddChannel(_mixerStream, _Stream, 0);
Bass.BASS_ChannelPlay(_Stream, false);


lame = new EncoderLAME(_mixerStream);



So, with PreSeacn my mixer don't stop when my Stream is down, but it's not possible to user STREAM_PRESCAN with   BASS_INIT(0, ....)
and LAME don't encode

I think think, the only solution for use STREAM_DECODE, it play in a loop a file with no sond in the mixer

Do you know if the are an other solution so create a non strop mixer this no sound card -BASS_INIT(0,...)



radio42

  • Posts: 4576
Re: BASS MIXER Without SoundCard
« Reply #1 on: 7 Aug '11 - 14:18 »
a) BASS_STREAM_PRESCAN can only be used with BASS_StreamCreateFile but not with a mixer
b) BASS_ChannelPlay should be called on the mixer and not on its source and only if the mixer is not a decoding one
c) if the mixer is a decoding one you need to call BASS_ChannelGetData yourself in a loop or timer to query data from it

Kma

  • Guest
Re: BASS MIXER Without SoundCard
« Reply #2 on: 8 Aug '11 - 09:18 »
I dont whant get data of mixer

I whant rec it, even when BASS_StreamCreateURL is fail (server down, infernet no connection)

With BASS_STREAM_PRESCAN, my mixer run already, but it's nessesary to use a soundcard, but if I init without sount card, the encoder (EncoderLAME(mixer)) "pause" the record

I serch a solution like PRESCAN with Bass_Init(0, ...)


Ian @ un4seen

  • Administrator
  • Posts: 20427
Re: BASS MIXER Without SoundCard
« Reply #3 on: 8 Aug '11 - 15:04 »
It isn't possible to play "decoding channels" (using the BASS_STREAM_DECODE flag), so the BASS_ChannelPlay call will be failing (with error code BASS_ERROR_DECODE). You will need to call BASS_ChannelGetData to process the mixer instead; you could do that in a timer.