chore: add jaad dependency to fix .m4a playback on Desktop

This commit is contained in:
Antoine Jaury
2026-09-30 11:18:54 +02:00
parent ac07be5634
commit 3acba87728
4 changed files with 16 additions and 1 deletions
+6 -1
View File
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Fixed
- Desktop: audio playback failed with *Failed to play audio* on every record,
because the JDK cannot decode the `.m4a` (AAC) recordings on its own.
## [1.0.0-alpha02] - 2026-08-04 ## [1.0.0-alpha02] - 2026-08-04
### Added ### Added
@@ -64,7 +69,7 @@ First public release of **Chom Bev e Brezhoneg**.
- Targets Android, iOS, Desktop (JVM) and Web (JS + Wasm), all sharing the same - Targets Android, iOS, Desktop (JVM) and Web (JS + Wasm), all sharing the same
Compose Multiplatform UI. Only Android has been deeply tested for this version. Compose Multiplatform UI. Only Android has been deeply tested for this version.
- Audio playback backed by ExoPlayer (Android), AVFoundation (iOS), the browser - Audio playback backed by ExoPlayer (Android), AVFoundation (iOS), the browser
audio APIs (Web). audio APIs (Web) and `javax.sound.sampled` (Desktop).
- Light and dark themes; interface localised in French and Breton. - Light and dark themes; interface localised in French and Breton.
- Modular architecture: `core`, `data` and `feature` modules glued by a thin - Modular architecture: `core`, `data` and `feature` modules glued by a thin
`shared` module, with Koin dependency injection validated at build time. `shared` module, with Koin dependency injection validated at build time.
+4
View File
@@ -13,6 +13,10 @@ kotlin {
implementation(libs.media3.exoplayer) implementation(libs.media3.exoplayer)
implementation(libs.media3.common) implementation(libs.media3.common)
} }
jvmMain.dependencies {
// Desktop audio: AAC/MP4 SPI so javax.sound.sampled can decode .m4a
implementation(libs.jaad)
}
// webMain is the js + wasmJs intermediate source set from the default hierarchy template. // webMain is the js + wasmJs intermediate source set from the default hierarchy template.
webMain.dependencies { webMain.dependencies {
// Browser audio (HTMLAudioElement, document) for js + wasmJs // Browser audio (HTMLAudioElement, document) for js + wasmJs
@@ -17,6 +17,10 @@ import kotlin.time.Duration.Companion.microseconds
/** /**
* Desktop [AudioPlayer] backed by [javax.sound.sampled]. * Desktop [AudioPlayer] backed by [javax.sound.sampled].
*
* The JDK decodes neither AAC nor its MP4 container, so the `.m4a` recordings are decoded to PCM by
* the jaad AAC provider on the classpath, which [AudioSystem] discovers automatically. Loading then
* works the same as for any natively supported format.
*/ */
internal class JvmAudioPlayer : AudioPlayer { internal class JvmAudioPlayer : AudioPlayer {
private var clip: Clip? = null private var clip: Clip? = null
+2
View File
@@ -10,6 +10,7 @@ composeIconsExtended = "1.7.3"
composeMultiplatform = "1.11.1" composeMultiplatform = "1.11.1"
datastore = "1.2.1" # https://developer.android.com/jetpack/androidx/releases/datastore datastore = "1.2.1" # https://developer.android.com/jetpack/androidx/releases/datastore
googleServices = "4.5.0" googleServices = "4.5.0"
jaad = "0.9.4"
kermit = "2.1.0" kermit = "2.1.0"
koin = "4.2.2" koin = "4.2.2"
kotlin = "2.4.10" kotlin = "2.4.10"
@@ -43,6 +44,7 @@ compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.re
compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "composeMultiplatform" } compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "composeMultiplatform" }
compose-uiTooling = { module = "org.jetbrains.compose.ui:ui-tooling", version.ref = "composeMultiplatform" } compose-uiTooling = { module = "org.jetbrains.compose.ui:ui-tooling", version.ref = "composeMultiplatform" }
compose-uiToolingPreview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "composeMultiplatform" } compose-uiToolingPreview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "composeMultiplatform" }
jaad = { module = "com.tianscar.javasound:jaad", version.ref = "jaad" }
koin-bom = { module = "io.insert-koin:koin-bom", version.ref = "koin" } koin-bom = { module = "io.insert-koin:koin-bom", version.ref = "koin" }
koin-compose = { module = "io.insert-koin:koin-compose" } koin-compose = { module = "io.insert-koin:koin-compose" }
koin-compose-viewmodel = { module = "io.insert-koin:koin-compose-viewmodel" } koin-compose-viewmodel = { module = "io.insert-koin:koin-compose-viewmodel" }