فهرست منبع

miniaudio: Add worklets config (#8657)

* miniaudio: Add worklets config

* Add support for audio worklets configuration

* Update xmake.lua

* Update build_defines.lua
Jérôme Leclercq 3 هفته پیش
والد
کامیت
664de7c11d
2فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 3 0
      packages/m/miniaudio/build_defines.lua
  2. 1 0
      packages/m/miniaudio/xmake.lua

+ 3 - 0
packages/m/miniaudio/build_defines.lua

@@ -69,5 +69,8 @@ function main(package)
     if not package:config("wav") then
         table.insert(defines, "MA_NO_WAV")
     end
+    if package:config("worklets") and package:is_plat("wasm") then
+        table.insert(defines, "MA_ENABLE_AUDIO_WORKLETS")
+    end
     return table.unique(defines)
 end

+ 1 - 0
packages/m/miniaudio/xmake.lua

@@ -32,6 +32,7 @@ package("miniaudio")
     add_configs("sse2", {description = "Enable SSE2 optimizations", default = true, type = "boolean"})
     add_configs("threading", {description = "Enable the threading API", default = true, type = "boolean"})
     add_configs("wav", {description = "Enable the builtin WAV decoder and encoder", default = true, type = "boolean"})
+    add_configs("worklets", {description = "Enable AudioWorklets when targeting web", default = true, type = "boolean"})
 
     if is_plat("iphoneos") then
         add_frameworks("AudioToolbox", "AVFoundation", "CoreFoundation", "Foundation")