Sorry for the basic question but I’m not finding how to do it, it does not have to do for me, but at least specify where I can learn how to do it.
I have a screen with several buttons and clicking on each button will have to be “played” an mp3 file, will be several, an audio I got, now I do not know where to look to have an audio for each button
<ion-content padding>
<p>
<ion-title color="dark">INICIADOS COM B</ion-title>
<ion-grid>
<ion-row align-items-center>
<ion-col><button ion-button block outline (click)="play()">bō</button></ion-col>
<ion-col><button ion-button block outline >bó</button></ion-col>
<ion-col><button ion-button block outline >bǒ</button></ion-col>
<ion-col><button ion-button block outline >bò</button></ion-col>
</ion-row>
constructor(public navCtrl: NavController,
public navParams: NavParams,
public platform: Platform,
private nativeAudio: NativeAudio) {
this.platform.ready().then(() => {
this.nativeAudio.preloadSimple('uniqueId1', 'assets/audio/ang.mp3').then((success)=>{
console.log("Carregado com Sucesso");
},(error)=>{
console.log(error);
});
});
}
play(){
this.nativeAudio.play('uniqueId1').then((success)=>{
console.log("Sucesso ao executar");
},(error)=>{
console.log(error);
});
}
I will be very grateful if you give me the stones, I do not want the fish, but I need help to know how to fish