<commit_before>(function () {
		function SongPlayer() {
			var SongPlayer = {};

			var currentSong = null;
			var currentBuzzObject = null;
			/**
			 * @function setSong
			 * @desc Stops currently playing song and loads new audio file as currentBuzzObject
			 * @param {Object} song
			 */
			var setSong = function (song) {
				if (currentBuzzObject) {
					currentBuzzObject.stop();
					currentSong.playing = null;
				}

				currentBuzzObject = new buzz.sound(song.audioUrl, {
					formats: ['mp3'],
					preload: true
				});

				currentSong = song;
			};
			SongPlayer.play = function (song) {
				if (currentSong !== song) {


					SongPlayer.pause = function (song) {
						currentBuzzObject.pause();
						song.playing = false;
					};

					currentSong = song;
					setSong(song);
					currentBuzzObject.play();
					song.playing = true;
				} else if (currentSong === song) {
					if (currentBuzzObject.isPaused()) {
						currentBuzzObject.play();
					}
				}
			};
		}
	};

	return SongPlayer;
}

angular
	.module('blocJams')
	.factory('SongPlayer', SongPlayer);
})();<commit_msg>assignment 7 services part 2 completed<commit_after>(function () {
		function SongPlayer() {
			var SongPlayer = {};

			var currentSong = null;
			var currentBuzzObject = null;
			/**
			 * @function setSong
			 * @desc Stops currently playing song and loads new audio file as currentBuzzObject
			 * @param {Object} song
			 */
			var setSong = function (song) {
				if (currentBuzzObject) {
					currentBuzzObject.stop();
					currentSong.playing = null;
				}

				currentBuzzObject = new buzz.sound(song.audioUrl, {
					formats: ['mp3'],
					preload: true
				});

				currentSong = song;
			};
			SongPlayer.play = function (song) {
				if (currentSong !== song) {


					SongPlayer.pause = function (song) {
						currentBuzzObject.pause();
						song.playing = false;
					};

					currentSong = song;
					setSong(song);
					currentBuzzObject.play();
					song.playing = true;
				} else if (currentSong === song) {
					if (currentBuzzObject.isPaused()) {
						currentBuzzObject.play();
					}
				}
			};
		}
	};
 
 //my private playSong function
 /**
 * @function playSong
 * @plays current song 
 * @param {Object} song
 */
    var playSong = function (song) {
				currentBuzzObject.play();
	            song.playing = true;
				};  

	return SongPlayer;
}

angular
	.module('blocJams')
	.factory('SongPlayer', SongPlayer);
})();
{'fraction_non_alphanumeric': 0.1309328968903437, 'fraction_numerical': 0.0016366612111292963, 'mean_word_length': 2.606194690265487, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '503311', 'n_tokens_mistral': 1060, 'n_tokens_neox': 749, 'n_words': 178}