Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions nga_binaural/binaural_point_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
from ear.options import OptionsHandler
from ear.core import bs2051, point_source
import pkg_resources
from ruamel import yaml
from ruamel.yaml import YAML
from . import sofa

"""this is a modified version of point_source.py from the EAR. It was modified to adapt to the binaural rendering structure."""

def _load_binaural_layouts():
fname = "data/binaural_layouts.yaml"
with pkg_resources.resource_stream(__name__, fname) as layouts_file:
layouts_data = yaml.safe_load(layouts_file)
yaml = YAML(typ='safe', pure=True)
layouts_data = yaml.load(layouts_file)

layouts = list(map(bs2051._dict_to_layout, layouts_data))

Expand All @@ -31,7 +32,8 @@ def _load_allo_positions_binaural():

fname = "data/binaural_layouts_allo.yaml"
with pkg_resources.resource_stream(__name__, fname) as layouts_file:
return yaml.safe_load(layouts_file)
yaml = YAML(typ='safe', pure=True)
return yaml.load(layouts_file)

@attrs(slots=True)
class StereoPanDownmix_Binaural(point_source.RegionHandler):
Expand Down