<commit_before>var BaseSoundManager = require('./BaseSoundManager');
var WebAudioSoundManager = require('./webaudio/WebAudioSoundManager');
var HTML5AudioSoundManager = require('./html5/HTML5AudioSoundManager');

var SoundManagerCreator = {

    create: function (game)
    {
        var audioConfig = game.config.audio;
        var deviceAudio = game.device.Audio;

        if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData))
        {
            // TODO add no audio implementation of BaseSoundManager
            return new BaseSoundManager(game);
        }

        if(deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio))
        {
            return new WebAudioSoundManager(game);
        }

        return new HTML5AudioSoundManager(game);
    }

};

module.exports = SoundManagerCreator;
<commit_msg>Competed a TODO to instantiate NoAudioSoundManager if there is no audio engine available or sounds are disabled in config<commit_after>var WebAudioSoundManager = require('./webaudio/WebAudioSoundManager');
var HTML5AudioSoundManager = require('./html5/HTML5AudioSoundManager');
var NoAudioSoundManager = require('./noaudio/NoAudioSoundManager');

var SoundManagerCreator = {

    create: function (game)
    {
        var audioConfig = game.config.audio;
        var deviceAudio = game.device.Audio;

        if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData))
        {
            return new NoAudioSoundManager(game);
        }

        if(deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio))
        {
            return new WebAudioSoundManager(game);
        }

        return new HTML5AudioSoundManager(game);
    }

};

module.exports = SoundManagerCreator;

{'fraction_non_alphanumeric': 0.1018363939899833, 'fraction_numerical': 0.004451864218141347, 'mean_word_length': 3.220657276995305, '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': '7465282', 'n_tokens_mistral': 475, 'n_tokens_neox': 465, 'n_words': 103}