Display title of file from AJAX on custom casette player [closed]

I am hoping someone can help me out.
OK, so I am creating a custom wordpress plugin which is based on this casette player demo from codrops: https://tympanus.net/codrops/2012/07/12/old-school-cassette-player-with-html5-audio/

I have so far created the metaboxes, custom post types etc, and added the required data to the WordPress REST API. For the actual audio tracks, the array from my AJAX request is working exactly as its supposed to, i.e. the player is working (nice!). The custom endpoint is here: https://dannysaber.dreamhosters.com/wp-json/wp/v2/songs and you can see the player working here: https://dannysaber.dreamhosters.com/tape-player-test/

What I would like to add here, is when a song is played, the title of the track is shown. I have managed to get the titles from the API, as an array, but I cannot figure out how to do this, my javascript is a bit rudimentary!

Another option I think that might work, is using something like this to get the ID3 tag of the actual tracks- https://github.com/aadsm/jsmediatags#browser (which also might support album art, if added). However, I think its best to get the data from the REST API. I am sure its possible, I just dont know how in this code to generate the song titles when a track is played. Am I doing the AJAX processing wrong? help is appreciated.

the code for the player is on this link (too long to copy here!) https://dannysaber.dreamhosters.com/wp-content/themes/dannysaber/js/jquery.cassette.js