I want to get access to all of whats been placed in the streambuffer(starting at 0) up to the very end. This code is to transfer the stream in its entirety to the floats[] array. It works if I dont use ChannelPlay till the very end(or not at all), but if I play the channel and it tries to copy the buffer(while playing) im getting what appears to be a part of the audio.
Ive tried BASS_ChannelSetPosition(_bassStream, 0) but that appears to clear the buffer first.
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_16BITS, IntPtr.Zero);
int _bassStream = Bass.BASS_StreamCreatePush(44100, 2, BASSFlag.BASS_SAMPLE_FLOAT, IntPtr.Zero);
Bass.BASS_ChannelPause(_bassStream);
Bass.BASS_StreamPutData(_bassStream, buffer, buffer.Length * 4);
Bass.BASS_ChannelPlay(_bassStream, false);
long amount = Bass.BASS_ChannelGetPosition(_bassStream, BASSMode. BASS_POS_DECODE) / 4;
float[] floats = new float[amount];
for (int cnt = 0; cnt < amount; cnt++)
floats[cnt] = Bass.BASS_ChannelGetData(_bassStream, floats, (int)amount);
Last post you said something about keeping track of the total, would I need to do this? And how would that make it work?
Thanks.