chore: add jaad dependency to fix .m4a playback on Desktop
This commit is contained in:
@@ -13,6 +13,10 @@ kotlin {
|
||||
implementation(libs.media3.exoplayer)
|
||||
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.dependencies {
|
||||
// Browser audio (HTMLAudioElement, document) for js + wasmJs
|
||||
|
||||
@@ -17,6 +17,10 @@ import kotlin.time.Duration.Companion.microseconds
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
private var clip: Clip? = null
|
||||
|
||||
Reference in New Issue
Block a user