I'm doing some CPU intensive work on this PublishS...
# rx
g
I'm doing some CPU intensive work on this PublishSubject here and thus I think I should do it on
Schedulers.computation()
. But, I can't figure out where to put the
observeOn()
here
Copy code
val publishSubject = PublishSubject.create<Double>().toSerialized()
            remoteAudioTrackPublication.audioTrack?.addSink(object : AudioSink {
                override fun renderSample(
                    audioSample: ByteBuffer,
                    encoding: Int,
                    sampleRate: Int,
                    channels: Int
                ) {
                    publishSubject.onNext(AudioProcessingHelper.calculateAudioVolume(audioSample))
                }
            })