Skip to content

Commit e9e477e

Browse files
authored
Add AudioPresets and increase default audio max bitrate to 48kbps (#551)
1 parent 4052700 commit e9e477e

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.changeset/cyan-cups-wave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"client-sdk-android": patch
3+
---
4+
5+
Add AudioPresets and increase default audio max bitrate to 48kbps

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
/.idea/deploymentTargetDropDown.xml
1111
/.idea/misc.xml
1212
/.idea/gradle.xml
13+
/.idea/runConfigurations.xml
14+
/.idea/deploymentTargetSelector.xml
1315
.DS_Store
1416
/build
1517
/captures
@@ -21,4 +23,4 @@
2123
node_modules/
2224
npm-debug.log
2325
yarn-debug.log
24-
yarn-error.log
26+
yarn-error.log

livekit-android-sdk/src/main/java/io/livekit/android/room/participant/LocalParticipant.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,11 +1107,22 @@ abstract class BaseAudioTrackPublishOptions {
11071107
abstract val red: Boolean
11081108
}
11091109

1110+
enum class AudioPresets(
1111+
val maxBitrate: Int,
1112+
) {
1113+
TELEPHONE(12_000),
1114+
SPEECH(24_000),
1115+
MUSIC(48_000),
1116+
MUSIC_STEREO(64_000),
1117+
MUSIC_HIGH_QUALITY(96_000),
1118+
MUSIC_HIGH_QUALITY_STEREO(128_000)
1119+
}
1120+
11101121
/**
11111122
* Default options for publishing an audio track.
11121123
*/
11131124
data class AudioTrackPublishDefaults(
1114-
override val audioBitrate: Int? = 20_000,
1125+
override val audioBitrate: Int? = AudioPresets.MUSIC.maxBitrate,
11151126
override val dtx: Boolean = true,
11161127
override val red: Boolean = true,
11171128
) : BaseAudioTrackPublishOptions()

0 commit comments

Comments
 (0)