def get_audio_mode(self):
        audio_config = open('/home/pi/tyos/configure/audio.conf', 'r')
        file = audio_config.readlines()

        for i in range(0, len(file)):#Parse file
            if file[i][0] == '#':
                pass
                #Do Nothing. Line is comment
            else:
                file[i] = file[i].rstrip()
                if 'mode' in file[i]: #Extract audio mode: 1=Built in, 0=External
                    mode = file[i]
        
        mode = mode.split('=')
        self.mode = int(mode[1])

        if self.mode == 1:
            self.headset = False
        else:
            self.headset = True
dataset/ETHPy150Open spadgenske/TYOS/apps/settings/settings.py/Run.get_audio_mode/original