commit 07/10/2025
This commit is contained in:
@@ -183,7 +183,9 @@ class MainExtension01 {
|
||||
*/
|
||||
fun Get_Soundbank_Data(value: String) : Map<String, String>? {
|
||||
if (ValidString(value)){
|
||||
//println("Parsing soundbank data from value: $value")
|
||||
val values = value.split(" ").map { it.trim() }.filter { ValidString(it) }
|
||||
//println("Split into values: $values")
|
||||
if (values.isNotEmpty()){
|
||||
val result = mutableMapOf<String, String>()
|
||||
values.forEach {
|
||||
@@ -192,6 +194,7 @@ class MainExtension01 {
|
||||
// ada separator
|
||||
val key = it.substring(0, separatorindex).trim().uppercase()
|
||||
val value = it.substring(separatorindex+1).trim().uppercase()
|
||||
//println("Got $key : $value")
|
||||
if (ValidString(key) && ValidString(value)){
|
||||
if (SoundbankKeywords.contains(key)) result[key] = value
|
||||
}
|
||||
@@ -338,11 +341,9 @@ class MainExtension01 {
|
||||
files.add(city.Path)
|
||||
} else {
|
||||
return Result_GetSoundbankFiles(false, "Invalid soundbank file ${city.Path} for tag=$_tag voicetype=${mb.Voice_Type} language=${mb.Language} ANN_ID=${mb.ANN_ID}")
|
||||
|
||||
}
|
||||
} else {
|
||||
return Result_GetSoundbankFiles(false, "No City found for tag=$_tag voicetype=${mb.Voice_Type} language=${mb.Language} ANN_ID=${mb.ANN_ID}")
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -537,7 +538,7 @@ class MainExtension01 {
|
||||
fun Read_Queue_Paging() : Boolean{
|
||||
db.queuepagingDB.Get()
|
||||
val list = db.queuepagingDB.List
|
||||
.filter { it.Source=="PAGING" }
|
||||
.filter { it.Type=="PAGING" }
|
||||
|
||||
list.forEach { qp ->
|
||||
println("Processing $qp")
|
||||
@@ -593,7 +594,7 @@ class MainExtension01 {
|
||||
fun Read_Queue_Shalat() : Boolean{
|
||||
db.queuepagingDB.Get()
|
||||
val list = db.queuepagingDB.List
|
||||
.filter { it.Source=="SHALAT" }
|
||||
.filter { it.Type=="SHALAT" }
|
||||
list.forEach { qp ->
|
||||
println("Processing $qp")
|
||||
if (qp.BroadcastZones.isNotBlank()){
|
||||
@@ -852,13 +853,15 @@ class MainExtension01 {
|
||||
|
||||
if (listafi.isNotEmpty()){
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
|
||||
val targetfile = SoundbankResult_directory.resolve(Make_WAV_FileName("Soundbank","")).toString()
|
||||
println("Writing to target WAV file: $targetfile")
|
||||
// bikin nama file ada postifx nya dari SB_TAGS, tapi spasi diganti underscore
|
||||
// dan titik dua diganti dash
|
||||
val postfix = qa.SB_TAGS.replace(" ","_").replace(":","-")
|
||||
val targetfile = SoundbankResult_directory.resolve(Make_WAV_FileName("${qa.Source}_${qa.Type}",postfix)).toString()
|
||||
//println("Writing to target WAV file: $targetfile")
|
||||
val result = audioPlayer.WavWriter(listafi, targetfile, true)
|
||||
if (result.success){
|
||||
// file siap broadcast
|
||||
println("Successfully wrote WAV file: $targetfile")
|
||||
//println("Successfully wrote WAV file: $targetfile")
|
||||
val targetafi = audioPlayer.LoadAudioFile(targetfile)
|
||||
if (targetafi.isValid()) {
|
||||
ips.forEach { ip -> StreamerOutputs[ip]?.SendData(targetafi.bytes, { db.Add_Log("AAS", it) }, { db.Add_Log("AAS", it) }) }
|
||||
|
||||
Reference in New Issue
Block a user