feat: add audio usage type so it's possible to force audio from earpiece speaker#105
Open
Egbert-Jan wants to merge 1 commit into
Open
feat: add audio usage type so it's possible to force audio from earpiece speaker#105Egbert-Jan wants to merge 1 commit into
Egbert-Jan wants to merge 1 commit into
Conversation
jspizziri
reviewed
Apr 17, 2024
| * The audio usage type. | ||
| */ | ||
| var audioUsageType: AudioUsageType = AudioUsageType.MEDIA | ||
| ) No newline at end of file |
Contributor
There was a problem hiding this comment.
please add a newline at the end of the file.
| } | ||
| } | ||
|
|
||
| private fun setAudioAttributes() { |
Contributor
There was a problem hiding this comment.
I don't personally love the function overloading here. Perhaps we could name this function something like applyAudioAttribute().
|
|
||
| fun setAudioAttributes(audioAttributeConfig: AudioAttributeConfig) { | ||
| scope.launch { | ||
| playerConfig = PlayerConfig( |
Contributor
There was a problem hiding this comment.
perhaps handleAudioFocus, audioUsageType, audioContentType should be updated to var's so that they could simply be mutated rather than replacing the entire PlayerConfig object. Not sure.
| @@ -0,0 +1,18 @@ | |||
| package com.doublesymmetry.kotlinaudio.models | |||
|
|
|||
| data class AudioAttributeConfig( | |||
Contributor
There was a problem hiding this comment.
I'm a bit on the fence about introducing this intermediate class just to encapsulate the arguments passed to the setAudio function. @dcvz will need to weigh in on it.
This file contains hidden or 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
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.
Makes it possible to set the audio usage attribute. By doing this it is possible to force the audio to come from the earpiece speaker. A useful use case is listening to voice messages.