Buzzer or tone using 8 ohm speaker

Hi,
I have an usecase to play a tone using 8 ohm speaker and amplifier. I used to use tone function from arduino but as this board is not arduino, can anyone please help me how to play tone using Cebecell GPS module?

Can you show the example code?

#include "Arduino.h"


void setup() {
  // put your setup code here, to run once:
	pinMode(PWM1,OUTPUT);
	
}



void loop() {
  // put your main code here, to run repeatedly:

 for(int i =0;i<5; i++){
  analogWrite(PWM1,10);//GPIO2
  delay(30);
  analogWrite(PWM1,30);//GPIO2
  delay(100);
  analogWrite(PWM1,50);//GPIO2
  delay(150);
  analogWrite(PWM1,0);//GPIO2
  delay(170);
 }
  

  
  
  delay(5000);

}

Here is the code. I am able to get the noise but not able to play any particular tone or play wav. All the ESp32 libraries such as ledcWrite etc don’t work as this is different board. Any suggestion how I can play some tone or play wav file ?