@neverender24 wrote:
I have some audio assets combined with mp3 and wav file. I have an application that loops through the data name and just combine it with the extension and get the source of the audio based on the name like the code below. My problem is that it only get the .wav file.
setTimeout( () => { this.audio.src = '../assets/audio/'+this.type+'/'+voice+'.wav'; if (!this.audio.src) { this.audio.src = '../assets/audio/'+this.type+'/'+voice+'.mp3'; } this.audio.play(); }, 400);
What will I do to play the .mp3 if the .wav is not found?
Currently my code is not working.
Posts: 5
Participants: 2