Not able to mute music

I am not been able to mute the music, in the create function I am playing the music and created a function to toggle the music.

Suppose this simple example, it is giving me an error
something like setMute(false) is not a function.

create() {
this.bgMusic=this.sound.add('bgm').setLoop(true).play();

this.bgMusic.setMute(true) ;
} 

play() returns true/false.

changed the code to this and it works, isn’t it strange, why the code in first post doesn’t worked and this works?

this.bgMusic=this.sound.add('bgm');
this.bgMusic.setLoop(true);
this.bgMusic.play();

//in the toggle function 
this.bgMusic.setMute(true);

The original code was doing

this.bgMusic = true;

this.bgMusic.setMute(true);

// -> TypeError: setMute is not a function.

OK, Thanks for the explanation…