I am not sure what you mean by layers in terms of music, but you should use a variable. For example, when player turns music on, set VariableMusic to 1, and if they turn it off, set VariableMusic to 0. Than save that variable to webstorage so that everytime you start the game, the setting is saved.