Skip to content

How to prevent Error Code -42 #60

@BenNathanaelTse

Description

@BenNathanaelTse

In my game I use different sounds for enemies.

After a specific time the player is not able to play any new sounds and also the older ones might not finish playing or are interrupted.

is there a way to just clean all the memory from sounds so it can start adding sounds anew?

e.g. after every battle a function can be run that all old sounds are removed?

i also have some predefined sounds in a func, should I remove this, or would this not matter? like:

func playTrapSound() {
Sound.play(file: "hitTrap", fileExtension: "mp3", numberOfLoops: 0)
}

Any help appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions