Ian, thank you for your help so far. I am using BASS in a Swift app to read audio from a file, generate it's spectrum, performs some manipulations on the spectrum, re-generate an audio waveform from these spectral manipulations, and finally to play the re-generated audio. The simplified BASS calls in my code are:
BASS_Init()
inputStream = BASS_StreamCreateFile()
BASS_ChannelPlay(inputStream, -1)
outputStream = BASS_StreamCreate()
Timer.scheduledTimer(withTimeInterval: 1.0/60.0, repeats: true) { _ in
BASS_ChannelGetData(inputStream, &spectrum, BASS_DATA_FFT16384)
// code to manipulate spectrum, re-generate an audio waveform, and put it into an outputAudioBuffer
BASS_StreamPutData( outputStream,
outputAudioBuffer,
UInt32(samplesPerFrame*4) )
} // end of Timer()
BASS_ChannelPlay( outputStream, 0 )
My problem is that this code sends two audio streams to my computer speakers. I would like to just hear the output (and not the input). But I need to use the BASS_ChannelPlay(inputStream) command to send the audio to the BASS_ChannelGetData(inputStream) to get my spectral values. How do I silence this BASS_ChannelPlay((inputStream), so that I can hear only the desired BASS_ChannelPlay(outputStream) ?