package com.peachpasswords.sync enum class GgwaveProtocol { AUDIBLE_NORMAL, AUDIBLE_FAST, AUDIBLE_FASTEST, ULTRASOUND_NORMAL, ULTRASOUND_FAST, ULTRASOUND_FASTEST, DT_NORMAL, DT_FAST, DT_FASTEST, } interface ChirpCodec { fun encode(payload: ByteArray): FloatArray fun decode(samples: FloatArray): ByteArray? fun free() } data class ChirpCodecOptions( val sampleRate: Int, val protocol: GgwaveProtocol = GgwaveProtocol.ULTRASOUND_FASTEST, val volumePercent: Int = 10, ) typealias ChirpCodecFactory = suspend (ChirpCodecOptions) -> ChirpCodec /** * Native ggwave binding placeholder. * * The browser source loads vendored JS/WASM at runtime. Android needs a * platform-specific audio bridge plus native codec binding, which is a * separate implementation step. The coordinator and tests inject their own * codec so the pairing protocol can still be exercised now. */ suspend fun createChirpCodec(opts: ChirpCodecOptions): ChirpCodec { throw UnsupportedOperationException( "Android ggwave codec is not yet implemented (sampleRate=${opts.sampleRate})", ) }