soywiz-archive/korge-next

readSoundInfo() returns null on JS target

Closed this issue · 1 comments

On the JS target, resourcesVfs["sound.mp3"].readSoundInfo() returns null but works fine on JVM. Please find attached a sample file that loads fine on JVM but fails on JS.

placeholder.zip

Here's the full code that fails (just in case it's something else):

            resourcesVfs["speech/"].list().collect {
                if (it.extension == "mp3") {
                    val fileName = it.baseNameWithoutExtension

                    val info = it.readSoundInfo()
                    val duration = info!!.duration

                    resources.speechDuration[fileName] = duration
                }
            }

Thanks for the prompt fix. Much appreciated!