Found a solution that works for me using switch()
I added a 3D Audio widget which is called "audio"
According to the current step which I get with
var stepNumber = $scope.app.view.Home.wdg["Model1"].currentStep;
I load the audio file into the widget and let it play. If 'stepNumber' is 1 it'll switch to 'case1' and so on. Haven't tried it with too many cases/files yet. Console logs are of course optional but my Vuforia Preview does not play any sound so I had to check in the console whether audios are executed. I ran it on the Hololens2 and it works just fine!
//play audio files according to step
$scope.playaudio= function(){
var stepNumber = $scope.app.view.Home.wdg["Model1"].currentStep;
switch(stepNumber){
case 1:
console.log(twx);
console.log($scope.app.view["Home"].wdg["audio"]);
$scope.app.view["Home"].wdg["audio"].audiosrc="app/resources/Uploaded/test1.mp3";
$scope.app.view["Home"].wdg["audio"].visible = true;
setTimeout(function(){
twx.app.fn.triggerWidgetService('audio', 'play');
}, 500);
break;
case 2:
console.log(twx);
console.log($scope.app.view["Home"].wdg["audio"]);
$scope.app.view["Home"].wdg["audio"].audiosrc="app/resources/Uploaded/test2.mp3";
$scope.app.view["Home"].wdg["audio"].visible = true;
setTimeout(function(){
twx.app.fn.triggerWidgetService('audio', 'play');
}, 500);
break;
}