Skip to content

Commit

Permalink
importance: test DirectSpeakers block filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjnixon committed Feb 26, 2024
1 parent becd25c commit ca3513f
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions ear/core/test/test_importance.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
from ..metadata_input import (
ObjectRenderingItem,
ObjectTypeMetadata,
DirectSpeakersRenderingItem,
DirectSpeakersTypeMetadata,
HOARenderingItem,
DirectTrackSpec,
ImportanceData,
MetadataSourceIter,
MetadataSource,
)
from ..metadata_input import ObjectTypeMetadata
from ..metadata_input import DirectTrackSpec
from ...fileio.adm.elements import AudioBlockFormatObjects
from ...fileio.adm.elements import (
AudioBlockFormatObjects,
AudioBlockFormatDirectSpeakers,
DirectSpeakerPolarPosition,
BoundCoordinate,
)
from ..importance import (
filter_by_importance,
filter_audioObject_by_importance,
Expand Down Expand Up @@ -139,10 +145,23 @@ def make_objects_type_metadata(**kwargs):
)


def make_direct_speakers_type_metadata(**kwargs):
return DirectSpeakersTypeMetadata(
block_format=AudioBlockFormatDirectSpeakers(
position=DirectSpeakerPolarPosition(
bounded_azimuth=BoundCoordinate(0.0),
bounded_elevation=BoundCoordinate(0.0),
),
**kwargs,
)
)


@pytest.mark.parametrize(
"make_type_metadata,make_rendering_item",
[
(make_objects_type_metadata, ObjectRenderingItem),
(make_direct_speakers_type_metadata, DirectSpeakersRenderingItem),
],
)
def test_importance_filter_blocks_single_channel(make_type_metadata, make_rendering_item):
Expand Down

0 comments on commit ca3513f

Please sign in to comment.