-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Add option to keep audio playing on device while mirroring #5102
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jul 16, 2024
Closed
Closed
Add a new method to capture audio playback. It requires Android 13 (where the Shell app has MODIFY_AUDIO_ROUTING permission). The main benefit is that it supports keeping audio playing on the device (implemented in a further commit). Fixes #4380 <#4380> PR #5102 <#5102> Co-authored-by: Simon Chan <1330321+yume-chan@users.noreply.github.com>
🚀 Here is a binary for the current
I will probably publish a new version v2.6 in 10~15 days. Consider this as a release candidate. |
This was referenced Jul 22, 2024
Closed
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
It is only used from AudioEncoder. PR Genymobile#5102 <Genymobile#5102>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
The AudioCaptureForegroundException was very specific. Rename it to AudioCaptureException to support other capture failures. PR Genymobile#5102 <Genymobile#5102>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
Replace a RuntimeException by a specific AudioCaptureException. PR Genymobile#5102 <Genymobile#5102>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
The compatibility depends on the capture constraints, not the encoding. This will allow to add a new capture implementation with different constraints. PR Genymobile#5102 <Genymobile#5102>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
This will allow to use these constants from different classes not directly related to AudioCapture. PR Genymobile#5102 <Genymobile#5102>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
This will allow to reuse this method. PR Genymobile#5102 <Genymobile#5102>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
Move the logic to read from an AudioRecord and handle all corner cases for PTS. This simplifies AudioCapture. PR Genymobile#5102 <Genymobile#5102>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
Move the implementation to AudioDirectCapture and extract an AudioCapture interface. This will allow to provide another AudioCapture implementation. PR Genymobile#5102 <Genymobile#5102>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
The MediaRecorder constant should not belong to the AudioSource enum. This will allow to add a new AudioSource which has no meaningful MediaRecorder audio source value. PR Genymobile#5102 <Genymobile#5102>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
Add a new method to capture audio playback. It requires Android 13 (where the Shell app has MODIFY_AUDIO_ROUTING permission). The main benefit is that it supports keeping audio playing on the device (implemented in a further commit). Fixes Genymobile#4380 <Genymobile#4380> PR Genymobile#5102 <Genymobile#5102> Co-authored-by: Simon Chan <1330321+yume-chan@users.noreply.github.com>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
Add an option to duplicate audio on the device, compatible with the new audio playback capture (--audio-source=playback). Fixes Genymobile#3875 <Genymobile#3875> Fixes Genymobile#4380 <Genymobile#4380> PR Genymobile#5102 <Genymobile#5102> Co-authored-by: Simon Chan <1330321+yume-chan@users.noreply.github.com>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
Automatically switch implicit audio source to "playback" if --audio-dup is passed. This allows to run: scrcpy --audio-dup without specifying explicitly: scrcpy --audio-source=playback --audio-dup PR Genymobile#5102 <Genymobile#5102>
FreedomBen
pushed a commit
to FreedomBen/scrcpy
that referenced
this pull request
Aug 2, 2024
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
It is only used from AudioEncoder. PR Genymobile#5102 <Genymobile#5102>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
The AudioCaptureForegroundException was very specific. Rename it to AudioCaptureException to support other capture failures. PR Genymobile#5102 <Genymobile#5102>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
Replace a RuntimeException by a specific AudioCaptureException. PR Genymobile#5102 <Genymobile#5102>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
The compatibility depends on the capture constraints, not the encoding. This will allow to add a new capture implementation with different constraints. PR Genymobile#5102 <Genymobile#5102>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
This will allow to use these constants from different classes not directly related to AudioCapture. PR Genymobile#5102 <Genymobile#5102>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
This will allow to reuse this method. PR Genymobile#5102 <Genymobile#5102>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
Move the logic to read from an AudioRecord and handle all corner cases for PTS. This simplifies AudioCapture. PR Genymobile#5102 <Genymobile#5102>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
Move the implementation to AudioDirectCapture and extract an AudioCapture interface. This will allow to provide another AudioCapture implementation. PR Genymobile#5102 <Genymobile#5102>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
The MediaRecorder constant should not belong to the AudioSource enum. This will allow to add a new AudioSource which has no meaningful MediaRecorder audio source value. PR Genymobile#5102 <Genymobile#5102>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
Add a new method to capture audio playback. It requires Android 13 (where the Shell app has MODIFY_AUDIO_ROUTING permission). The main benefit is that it supports keeping audio playing on the device (implemented in a further commit). Fixes Genymobile#4380 <Genymobile#4380> PR Genymobile#5102 <Genymobile#5102> Co-authored-by: Simon Chan <1330321+yume-chan@users.noreply.github.com>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
Add an option to duplicate audio on the device, compatible with the new audio playback capture (--audio-source=playback). Fixes Genymobile#3875 <Genymobile#3875> Fixes Genymobile#4380 <Genymobile#4380> PR Genymobile#5102 <Genymobile#5102> Co-authored-by: Simon Chan <1330321+yume-chan@users.noreply.github.com>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
Automatically switch implicit audio source to "playback" if --audio-dup is passed. This allows to run: scrcpy --audio-dup without specifying explicitly: scrcpy --audio-source=playback --audio-dup PR Genymobile#5102 <Genymobile#5102>
Gottox
pushed a commit
to Gottox/scrcpy
that referenced
this pull request
Sep 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a new method to capture audio on the device, provided by @yume-chan in #4380. It is exposed as a separate audio source (in addition to
output
andmic
):There are pros and cons, as noted by @yume-chan:
With this audio source, it is possible to request to keep playing on the device while mirroring:
If the audio source is not specified and
--audio-dup
is set, then it is implicitly set to--audio-source=playback
:scrcpy --audio-dup # equivalent
Fixes #3875