Hi, I'm trying to listen on speakers, save on the disk as file (encoded in Vorbis, BASS_Encode_OGG_StartFile) and broadcast (using cast to icecast, BASS_Encode_CastInit) the output of a mixer (BASS_Mixer_StreamCreate) with several added streams (2 or 3, BASS_StreamCreateFile) and a external input from sound card (BASS_RecordStart, BASS_Mixer_StreamAddChannel).
Not all playing at the same time, maybe only two of them at the same time but most of time only one. I think this last point will not change the approach as I can StreamAddChannel, ChannelRemove or even mute the source on need. The speakers are on a single output device. And if latency between stream input and speakers output could be around 100ms or less could be appreciated, but <1s will be ok.
The problem is a mixer need BASS_STREAM_DECODE source streams so... how to play in real-time thru the speakers and how I can use everything to encode to file and to cast, this will need an BASS_STREAM_DECODE mixer too (and ideally using different bitrate for each so I think I will need different encoders, not sure if they can share the same source or the lib doing the internal ChannelGetData will steal data from each other encoder).
So, how to play to hear the mixer on speakers (and how to control mixed streams as a separated/independent players: play, pause, stop, seek, get time, change volume level etc. without stalling the mixer or interfering each other) and at the same time have the mixer data available to encode to save to disk and cast. I looked at the BASS_Split_StreamCreate but doesn't seem the ideal solution as streams will get out-of-sync between can is hear on speaker and what is encoded/cast/saved and I should have to manage play, pause, etc. separately... not ideal for me, a lot of duplicated and error-prone code.
Maybe it's simply not possible and I need a different "architecture" or approach to accomplish this. I just need a few pointers in the right direction and some advice on which flags I should use. Thanks!