Skip to content

Commit

Permalink
Merge pull request #23 from google/sharingmodes
Browse files Browse the repository at this point in the history
Clearer explanation for exclusive sharing mode
  • Loading branch information
dturner authored Dec 12, 2017
2 parents 6d6fb8d + 2da496d commit ca64ea1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions FullGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ The audio device attached to a stream determines whether the stream is for input

A stream has a sharing mode:

* `SharingMode::Exclusive` (available on API 26+) means the stream has exclusive access to its audio device; the device cannot be used by any other audio stream. If the audio device is already in use, it might not be possible for the stream to have exclusive access. Exclusive streams provide the lowest possible latency, but they are also more likely to get disconnected. You should close exclusive streams as soon as you no longer need them, so that other apps can access the device.
* `SharingMode::Shared` allows Oboe to mix audio. Oboe mixes all the shared streams assigned to the same device.
* `SharingMode::Exclusive` (available on API 26+) means the stream has exclusive access to an endpoint on its audio device; the endpoint cannot be used by any other audio stream. If the exclusive endpoint is already in use, it might not be possible for the stream to obtain access to it. Exclusive streams provide the lowest possible latency by bypassing the mixer stage, but they are also more likely to get disconnected. You should close exclusive streams as soon as you no longer need them, so that other apps can access that endpoint. Not all audio devices provide exclusive endpoints. System sounds and sounds from other apps can still be heard when an exclusive stream is in use as they use a different endpoint.

You can explicitly request the sharing mode when you create a stream, although you are not guaranteed to receive that mode. By default,
the sharing mode is `Shared`.
![Oboe exclusive sharing mode diagram](oboe-sharing-mode-exclusive.jpg)

* `SharingMode::Shared` allows Oboe to mix audio. Oboe mixes all the shared streams assigned to the same endpoint on the audio device.

![Oboe exclusive sharing mode diagram](oboe-sharing-mode-shared.jpg)


You can explicitly request the sharing mode when you create a stream, although you are not guaranteed to receive that mode. By default, the sharing mode is `Shared`.

### Audio format

Expand Down
Binary file added oboe-sharing-mode-exclusive.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added oboe-sharing-mode-shared.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ca64ea1

Please sign in to comment.