<commit_before>GameFramework.Sound = function (audio) {
    if (!audio)
        console.error('audio not defined');
        
    this.audio = audio;
    return this;
};

GameFramework.Sound.prototype = {
    play: function () {
        var audio = this.audio;
        try {
            audio.pause();
            audio.currentTime = 0;    
        } catch (e) {
            console.log(e);
            audio.load();
        }
        audio.play();
    },
    
    dispose: function () {
        this.audio = undefined;
    }
};
<commit_msg>Inserting some comments to explain play method.<commit_after>GameFramework.Sound = function (audio) {
    if (!audio)
        console.error('audio not defined');
        
    this.audio = audio;
    return this;
};

GameFramework.Sound.prototype = {
    play: function () {
        var audio = this.audio;
        // you cannot play the same audio at same time...
        try {
            // reset the audio if it is playing 
            audio.pause();
            audio.currentTime = 0;    
        } catch (e) {
            console.log(e);
            audio.load();
        }
        audio.play();
    },
    
    dispose: function () {
        this.audio = undefined;
    }
};

{'fraction_non_alphanumeric': 0.12285012285012285, 'fraction_numerical': 0.001638001638001638, 'mean_word_length': 1.5352697095435686, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '243039', 'n_tokens_mistral': 344, 'n_tokens_neox': 340, 'n_words': 85}