diff --git a/src/audio/Mp3Encoder.kt b/src/audio/Mp3Encoder.kt index 8a50a6b..7ce1954 100644 --- a/src/audio/Mp3Encoder.kt +++ b/src/audio/Mp3Encoder.kt @@ -34,6 +34,7 @@ class Mp3Encoder(val samplingrate: Int=44100, val channels: Int=1) { if (sourcehandle == push_handle) { val data = ByteArray(length) buffer.read(0, data, 0, length) + callback?.accept(data) } else Logger.error { "MP3 Encoder callback called with unknown source handle: $sourcehandle" } } else Logger.error { "MP3 Encoder callback called with unknown encoder handle: $enchandle" } @@ -57,7 +58,7 @@ class Mp3Encoder(val samplingrate: Int=44100, val channels: Int=1) { callback = cb CoroutineScope(Dispatchers.Default).launch { - val readsize = 4*1024 // 4 K buffer + val readsize = 32*1024 // 32 K buffer Logger.info{"MP3 Encoder started successfully." } while(isActive && push_handle!=0){ val p = Memory(readsize.toLong()) @@ -68,7 +69,9 @@ class Mp3Encoder(val samplingrate: Int=44100, val channels: Int=1) { Logger.error{"Failed to read data from MP3 Encoder stream. BASS error code: $err" } break } - delay(2) + + + delay(100) } Logger.info{"MP3 Encoder finished successfully." } } diff --git a/src/google/GoogleTTS.kt b/src/google/GoogleTTS.kt new file mode 100644 index 0000000..c69a688 --- /dev/null +++ b/src/google/GoogleTTS.kt @@ -0,0 +1,14 @@ +package google + +class GoogleTTS { + + // project : Gtc-Cloud-AAS + // project ID : gtc-cloud-aas + // project number : 247742838587 + // location : indonesia-southeast1 + // name : API key 1 + // creation date : 21 Nov 2025 + // read : https://docs.cloud.google.com/vertex-ai/generative-ai/docs/reference/libraries#client-libraries-usage-java + private val BoundAccount = "vertex-express@gtc-cloud-aas.iam.gserviceaccount.com" + private val API_KEYS = "AQ.Ab8RN6K2ZF6wykKVJcuHsfm0po9IXn3alBpO5cfZzPb4lq35Yw" +} \ No newline at end of file