Hello everyone,
am trying to achieve a pitch shift on a recording voice and play it back instantaneosly. To avoid audio feedback I must try to catch the input via Audio Units from the mic, apply the pitch shift via BASS_TempoCreate and play back using BASS. Or could I play back via audio units?
Thanks to this post I have tried to wire my working BASS code into the aurioTouch example. But since I am actually trying to play the sound, I need the -1 in BASS_Init, correct? I.e. BASS_Init(-1, 44100, 0, NULL, NULL). I was not allowed to insert this code in front of the aurioTouch audiosession init code, this caused an audio session error. So I insert it afterwards. BASS_getErrorCode throws no errors.
I then create the stream with
fxstream=BASS_StreamCreate(44100, 1,BASS_STREAM_DECODE,STREAMPROC_PUSH,0);
BASS_ChannelSetAttribute(fxstream, BASS_ATTRIB_NOBUFFER,0);
BASS_ChannelPlay(fxstream,FALSE);
BASS_ChannelSetAttribute fails with error code 37 (BASS_ERROR_NOTAVAIL).
BASS_ChannelSetAttribute fails with error code 38 (BASS_ERROR_DECODE).
In the aurioTouch callback I inserted
BASS_StreamPutData(fxstream,ioData->mBuffers[0].mData, ioData->mBuffers[0].mDataByteSize);
(fxstream is declared in the actual .mm file, so no need for "THIS->"). This call throws no errors. But a
BASS_ChannelGetPosition(fxstream,BASS_POS_BYTE);
returns 0.
And my app is silent.
How did you guys ever get aurioTouch to play the fxstream?
Thanks for any clues!