Giter Club home page Giter Club logo

Comments (4)

SomeTroglodyte avatar SomeTroglodyte commented on May 27, 2024

Do you have a mod containing these sounds or only builtin from jar/apk? I've long suspected builtin regressed but never bothered to look closer. No need to answer, yes, fallback to internal is the root cause, so it works with that mod or running from source but not without mod and from apk/jar.

from unciv.

SomeTroglodyte avatar SomeTroglodyte commented on May 27, 2024
    /** Scans all mods [folder]s for [name] with a supported sound extension,
     *  with fallback to _internal_ assets [folder] */
    private fun getMatchingFiles(folder: String, name: String) =
        getMusicFolders(folder) { Gdx.files.internal(folder) }
            .flatMap {
                it.list { file: File ->
                    file.nameWithoutExtension == name && file.exists() && !file.isDirectory &&
                    file.extension in gdxSupportedFileExtensions
                }.asSequence()
            }

The comment is right - it falls back to internal per folder - but it needs to fall back per individual file. That should be covered by it being a Sequence and by then chaining Sequence transforms only, but - that idea breaks, likely because File.list() isn't a Sequence, Flow or Stream - or because the idea is flawed. Will need a little time to debug and decide.
(Can we switch from Gdx.files to java.nio? nio does have async folder listing...)
Will have other hard to detect negative consequences, too.

Wrong analysis. It's there but it's not the breadth-first vs depth-first thing..

from unciv.

Ouaz avatar Ouaz commented on May 27, 2024

Ah yes, sorry, I only connect now.

Built-in sounds and it was working a few versions ago (~ 4.80 I think).
I remember lowering the volume because of the modern era city sound which is kind of annoying with the continuous "honk-honk" (other ambient sounds are great though).

from unciv.

SomeTroglodyte avatar SomeTroglodyte commented on May 27, 2024

a few versions ago

Yes, I replaced the separate fork of MusicController (which is responsible for any audio that's streamed from storage instead of loaded in RAM) with an added track capability of the central MusicController - reusing existing "find" code.

"honk-honk"

Précisement! That was the trigger, especially as these files are meant for looping and as such have no gradual lead-in. So they needed the "fade" capability of MusicController. Still needs to follow pause-when-minimized though, that didn't come automatically and I forgot.

from unciv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.