opentok-ios-sdk-samples
opentok-ios-sdk-samples copied to clipboard
Disabling all voice processing and filtering in custom audio driver
Hello,
We are having some issues with poor audio quality when playing instruments over Opentok. The suggestion in the React Native issue I opened was to implement the custom audio driver and use kAudioUnitSubType_RemoteIO
only.
We tested the Custom Audio Driver in this repo with the following results. Attached are Opentok Playground archive samples to illustrate the issues: archive-tests 2.zip
- with-voiceprocessing.webm - uses the default
kAudioUnitSubType_VoiceProcessingIO
. Result: Bad overall quality - remoteio.webm - uses
kAudioUnitSubType_RemoteIO
Result: Better quality, but being filtered (more on this below) - remoteio-AVAudioSessionModeMeasurement.webm - uses
kAudioUnitSubType_RemoteIO
and sets AVAudioSession tosetMode:AVAudioSessionModeMeasurement
in order to bypass the high-pass filter that is apparently still applied with RemoteIO (per https://stackoverflow.com/q/32227585/193210). (no difference in quality that I can tell from #2).
If you noticed with the kAudioUnitSubType_RemoteIO
recordings, there is some sort of distortion and/or filter happening that makes higher ranges, e.g. the higher notes on the guitar sound poor. I'm wondering if someone could at least point me in the right direction on what to try next.
I've tried messing with some of the stream_format settings, but things just get crazy sounding :). Thanks for any insight.
cc @msach22 if you can loop in any iOS folks that can assist.
Hi, Did you change the sampling rate?
Hi @bstmobfriend105, no I have not changed the sample rate. I left it at:
stream_format.mSampleRate = (Float64) kSampleRate;
which is defined as
// Simulator *must* run at 44.1 kHz in order to function properly.
#if (TARGET_IPHONE_SIMULATOR)
#define kSampleRate 44100
#else
#define kSampleRate 48000
#endif
There are known constraints to sample rates and formats inherited from both the WebRTC runtime and iOS. The rates chosen in the sample audio device are known working configurations, but not everything will work. The simulator needs to run at 44.1 kHz. Devices should stick between 8-32 kHz.
@snobear Can you try setting the higher bitrate value on OTPublisherSettings.audioBitrate
? (see documentation or OTPublisherKit.h
for help.)
@bsrao sure I'll try that. For some reason I'm getting EXC_BAD_ACCESS
while running a fresh copy of the Custom-Audio-Driver project currently. Fixing that first and will try various bitrate settings.
@bsrao sure I'll try that. For some reason I'm getting
EXC_BAD_ACCESS
while running a fresh copy of the Custom-Audio-Driver project currently. Fixing that first and will try various bitrate settings.
We're you able to fix this? Having same issue?
@uma-speaks no I'm still getting EXC_BAD_ACCESS
. I'm thinking this started happening with an update to either iOS (currently running 13.3) or Xcode (currently running 11.3 on Mojave 10.14.6).
I've opened another issue for this: #202