# Path: xnb_parse/file_formats/wav.py
# def write_wav(filename, header, data, needs_swap):
#     PyWavWriter(header, data, needs_swap=needs_swap).write(filename)
# 
# Path: xnb_parse/file_formats/xml_utils.py
# def output_xml(xml, filename):
# def output_xml(xml, filename):
# 
# Path: xnb_parse/xna_types/xna_primitive.py
# class Enum(object):
#     __slots__ = ('_value', '_name')
#     enum_values = None
#     xml_tag = None
# 
#     def __init__(self, value):
#         self._value = value
#         self._name = None
#         if value is not None:
#             self._name = self.enum_values[value]
# 
#     @property
#     def value(self):
#         return self._value
# 
#     @property
#     def name(self):
#         return self._name
# 
#     def __str__(self):
#         return self._name
# 
#     def __repr__(self):
#         return '{}({})'.format(self.__class__.__name__, self._value)
# 
#     def xml(self, parent):
#         xml_tag = self.xml_tag if self.xml_tag else self.__class__.__name__
#         root = ET.SubElement(parent, xml_tag)
#         root.text = self._name
#         return root


from xnb_parse.file_formats.wav import write_wav
from xnb_parse.file_formats.xml_utils import ET
from xnb_parse.xna_types.xna_primitive import Enum
"""
media types
"""

from __future__ import print_function



class SoundEffect(object):
    def __init__(self, sound_format, sound_data, loop_start, loop_length, duration, needs_swap=False):
        self.sound_format = sound_format
        self.sound_data = sound_data
        self.loop_start = loop_start
        self.loop_length = loop_length
        self.duration = duration
        self.needs_swap = needs_swap

    def __str__(self):
        return "SoundEffect fs:{} ds:{} d:{}ms ls:{} ll:{}".format(len(self.sound_format), len(self.sound_data),
                                                                   self.duration, self.loop_start, self.loop_length)

    def export(self, filename):
        write_wav(filename, self.sound_format, self.sound_data, self.needs_swap)

    def xml(self, parent=None):
        if parent is None:

# Path: xnb_parse/file_formats/wav.py
# def write_wav(filename, header, data, needs_swap):
#     PyWavWriter(header, data, needs_swap=needs_swap).write(filename)
# 
# Path: xnb_parse/file_formats/xml_utils.py
# def output_xml(xml, filename):
# def output_xml(xml, filename):
# 
# Path: xnb_parse/xna_types/xna_primitive.py
# class Enum(object):
#     __slots__ = ('_value', '_name')
#     enum_values = None
#     xml_tag = None
# 
#     def __init__(self, value):
#         self._value = value
#         self._name = None
#         if value is not None:
#             self._name = self.enum_values[value]
# 
#     @property
#     def value(self):
#         return self._value
# 
#     @property
#     def name(self):
#         return self._name
# 
#     def __str__(self):
#         return self._name
# 
#     def __repr__(self):
#         return '{}({})'.format(self.__class__.__name__, self._value)
# 
#     def xml(self, parent):
#         xml_tag = self.xml_tag if self.xml_tag else self.__class__.__name__
#         root = ET.SubElement(parent, xml_tag)
#         root.text = self._name
#         return root


# Path: xnb_parse/xna_types/xna_media.py
from xnb_parse.file_formats.wav import write_wav
from xnb_parse.file_formats.xml_utils import ET
from xnb_parse.xna_types.xna_primitive import Enum

"""
media types
"""

from __future__ import print_function



class SoundEffect(object):
    def __init__(self, sound_format, sound_data, loop_start, loop_length, duration, needs_swap=False):
        self.sound_format = sound_format
        self.sound_data = sound_data
        self.loop_start = loop_start
        self.loop_length = loop_length
        self.duration = duration
        self.needs_swap = needs_swap

    def __str__(self):
        return "SoundEffect fs:{} ds:{} d:{}ms ls:{} ll:{}".format(len(self.sound_format), len(self.sound_data),
                                                                   self.duration, self.loop_start, self.loop_length)

    def export(self, filename):
        write_wav(filename, self.sound_format, self.sound_data, self.needs_swap)

    def xml(self, parent=None):
        if parent is None:

            root = ET.Element('SoundEffect')