# Path: vulk/exception.py
# class SDL2Error(VulkError):
#     pass
# 
# class SoundError(VulkError):
#     pass


import logging
import sdl2
from sdl2 import sdlmixer as mixer
from sdl2.ext.compat import byteify
from vulk.exception import SDL2Error, SoundError
'''Audio module

This module contains all audio related classes.
'''



logger = logging.getLogger()


class VulkAudio():
    '''This class is only used in baseapp.

    It initializes and close the audio system.
    '''
    def open(self, configuration):
        '''Open and configure audio system

        *Parameters:*

        - `configuration`: Configuration parameters from Application
        '''
        if sdl2.SDL_InitSubSystem(sdl2.SDL_INIT_AUDIO) != 0:
            msg = "Cannot initialize audio system: %s" % sdl2.SDL_GetError()
            logger.critical(msg)

# Path: vulk/exception.py
# class SDL2Error(VulkError):
#     pass
# 
# class SoundError(VulkError):
#     pass


# Path: vulk/audio.py
import logging
import sdl2
from sdl2 import sdlmixer as mixer
from sdl2.ext.compat import byteify
from vulk.exception import SDL2Error, SoundError

'''Audio module

This module contains all audio related classes.
'''



logger = logging.getLogger()


class VulkAudio():
    '''This class is only used in baseapp.

    It initializes and close the audio system.
    '''
    def open(self, configuration):
        '''Open and configure audio system

        *Parameters:*

        - `configuration`: Configuration parameters from Application
        '''
        if sdl2.SDL_InitSubSystem(sdl2.SDL_INIT_AUDIO) != 0:
            msg = "Cannot initialize audio system: %s" % sdl2.SDL_GetError()
            logger.critical(msg)

            raise SDL2Error(msg)