Open xkkjiayou opened 2 weeks ago
您好,这个项目实在太伟大了,感谢技术专家们!!! 可以给个网络音频URL保存到本地,并驱动数字人说话的代码示例嘛
我看代码应该是在这里二次开发,但是不知道具体怎么做,方便给一些示例嘛,感谢
private fun playWav() { val wavName = "trans_7d9e53e8-2ece-11ef-bb8e-923c94a1fa2c.wav" val wavDir = File(mContext.getExternalFilesDir("duix"), "wav") if (!wavDir.exists()) { wavDir.mkdirs() } val wavFile = File(wavDir, wavName) if (!wavFile.exists()) { // 拷贝到sdcard val executor = Executors.newSingleThreadExecutor() executor.execute { val input = mContext.assets.open("wav/${wavName}") val out: OutputStream = FileOutputStream("${wavFile.absolutePath}.tmp") val buffer = ByteArray(1024) var read: Int while (input.read(buffer).also { read = it } != -1) { out.write(buffer, 0, read) } input.close() out.close() File("${wavFile.absolutePath}.tmp").renameTo(wavFile) duix?.playAudio(wavFile.absolutePath) } } else { duix?.playAudio(wavFile.absolutePath) } }
很棒的项目 最近刚刚完整走通, 没想到音频驱动效果这么好
您好,这个项目实在太伟大了,感谢技术专家们!!! 可以给个网络音频URL保存到本地,并驱动数字人说话的代码示例嘛
我看代码应该是在这里二次开发,但是不知道具体怎么做,方便给一些示例嘛,感谢