Skip to content

Commit

Permalink
oboe: warn user of permission errors
Browse files Browse the repository at this point in the history
AAudio returns confusing error codes when an open
fails due to permission errors. Suggest a possible reason.

Related to #888
  • Loading branch information
philburk committed Jun 17, 2020
1 parent cb01be5 commit 1f62387
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/aaudio/AudioStreamAAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ Result AudioStreamAAudio::open() {
mAAudioStream.store(stream);
}
if (result != Result::OK) {
// Warn developer because ErrorInternal is not very informative.
if (result == Result::ErrorInternal && mDirection == Direction::Input) {
LOGW("AudioStreamAAudio.open() may have failed due to lack of "
"audio recording permission.");
}
goto error2;
}

Expand Down

0 comments on commit 1f62387

Please sign in to comment.