Skip to content

Commit

Permalink
Tweaks to the new music annoucements
Browse files Browse the repository at this point in the history
  • Loading branch information
JudahGabriel committed Dec 26, 2024
1 parent 1067e97 commit 7f336fb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions Chavah.NetCore/wwwroot/js/Services/AudioPlayerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,7 @@ namespace BitShuva.Chavah {
}
}

private isPlayingAnnouncement(): boolean {
return !!this.audio.src && (this.audio.src.includes("/api/cdn") || this.audio.src.includes("/soundEffects/"));
}

private erred(args: ErrorEvent) {
if (this.isPlayingAnnouncement()) {
// If we're playing an announcement, don't worry about it. Just play the next thing.
this.ended();
return;
}

this.status.onNext(AudioStatus.Erred);
const currentSong = this.song.getValue();
const errorInfo: IAudioErrorInfo = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace BitShuva.Chavah {
// First play the announcement, "next up is new music..."
const newMusicAnnouncementCount = 6;
const randomNewMusicNumber = randomNumber(1, newMusicAnnouncementCount);
const newMusicUrl = `${this.homeViewModel.soundEffects}/new-music-${randomNewMusicNumber}.mp3`;
const newMusicUrl = `${this.homeViewModel.soundEffects}/new-music-${randomNewMusicNumber}x.mp3`;
this.audioPlayer.playNewUri(newMusicUrl);
} else {
// Then play the actual new song and reset our state.
Expand Down

0 comments on commit 7f336fb

Please sign in to comment.