def parse_voice_flags(flags):
    """Parses flags and returns a dict that represents voice playing state."""
    # flags: [0-9]{8}
    if flags[0] == '0':
        return {'voice': 'stop'}
    else:
        return {'voice': {
            'number': int(flags[1:3]),
            'repeat': int(flags[4:6])
        }}