Ion-slides with different audio

Hi, I have an app I’m working on using ion-slides. In each slides, I want different mp3 audios to play as the slide changes. The problem here is how to load my audio files into the DOM and have them playing as the slide changes.
here is my code


    <ion-slides  options="options" slider="data.slider">
      <ion-slide-page ng-repeat="letters in alphabets">
        <div class="box"><img ng-src="img/{{letters.img}}"></div>
        <audio controls source src="{{trustSrc(}}" type="audio/mpeg"></audio>


controllers here
.controller(‘alphabetController’, function($scope, $ionicSlideBoxDelegate, $ionicLoading, $cordovaMedia, $sce) {
$scope.alphabets = [
img: ‘a.jpg’,
audio: ‘a.mp3’
img: ‘b.jpg’,
audio: ‘b.mp3’
img: ‘c.jpg’,
audio: ‘c.mp3’
img: ‘d.jpg’,
audio: ‘d.mp3’
img: ‘e.png’,
audio: ‘e.mp3’

$scope.options = {
  loop: true,
  effect: 'fade',
  speed: 5000,
  autoplay: true

$ = function(src){
	var media = new Media(src, null, null, mediaStatusCallback);

var mediaStatusCallback = function(status){
	if (status == 1) {
		${template: 'Loading'});

$scope.$on("$ionicSlides.sliderInitialized", function(event, data){
  // data.slider is the instance of Swiper
  $scope.slider = data.slider;

$scope.$on("$ionicSlides.slideChangeStart", function(event, data){
  //console.log('Slide change is beginning');
     // this is where I think the magic takes place not sure please help.
     //$ each media one after the other as the slide changes

$scope.$on("$ionicSlides.slideChangeEnd", function(event, data){
  // note: the indexes are 0-based
  $scope.activeIndex = data.slider.activeIndex;
  $scope.previousIndex = data.slider.previousIndex;

$scope.trustSrc = function(src) {
return $sce.trustAsResourceUrl(src);


here’s a similar pen I wanna share
Same problem…how to add audio into each slide and make them play one after the other as each slides passes away.

Yes!!! I got it. I just figure it out right now. What I did was to call a function which select all the audio tags in the DOM and then play each one of them when each slides are active.
Here’s a demo.

// This is use when slides are active
$scope.$on("$ionicSlides.slideChangeStart", function(event, data){
//console.log($scope.activeIndex) which shows index values;
function myFunction(number) {
var player = document.querySelectorAll(".audio");