Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling all voice processing and filtering in custom audio driver #199

Closed
snobear opened this issue Dec 4, 2019 · 8 comments
Closed

Comments

@snobear
Copy link
Contributor

snobear commented Dec 4, 2019

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

  1. with-voiceprocessing.webm - uses the default kAudioUnitSubType_VoiceProcessingIO. Result: Bad overall quality
  2. remoteio.webm - uses kAudioUnitSubType_RemoteIO Result: Better quality, but being filtered (more on this below)
  3. remoteio-AVAudioSessionModeMeasurement.webm - uses kAudioUnitSubType_RemoteIO and sets AVAudioSession to setMode: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 Initial Overlay-Graphics Cookbook sample OPENTOK-11524 #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.

@snobear
Copy link
Contributor Author

snobear commented Dec 4, 2019

cc @msach22 if you can loop in any iOS folks that can assist.

@bstmobfriend105
Copy link

Hi,
Did you change the sampling rate?

@snobear
Copy link
Contributor Author

snobear commented Dec 14, 2019

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

@bstmobfriend105
Copy link

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.

@bsrao
Copy link

bsrao commented Dec 16, 2019

@snobear Can you try setting the higher bitrate value on OTPublisherSettings.audioBitrate ? (see documentation or OTPublisherKit.h for help.)

@snobear
Copy link
Contributor Author

snobear commented Dec 19, 2019

@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.

@uma-speaks
Copy link

@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?

@snobear
Copy link
Contributor Author

snobear commented Jan 16, 2020

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants