diff --git a/src/ansys/sound/core/sound_composer/source_broadband_noise.py b/src/ansys/sound/core/sound_composer/source_broadband_noise.py index 86cd52159..1303fcd39 100644 --- a/src/ansys/sound/core/sound_composer/source_broadband_noise.py +++ b/src/ansys/sound/core/sound_composer/source_broadband_noise.py @@ -141,7 +141,7 @@ def source_bbn(self) -> FieldsContainer: """Broadband noise source data, as a DPF fields container. The broadband noise source data consists of a series of spectra, each corresponding to a - control parameter value. Spectra can be narrowband, PSD, octave-band levels, or + control parameter value. Spectra can be narrowband (in dB or dB/Hz), octave-band levels, or 1/3-octave-band levels. """ return self.__source_bbn @@ -170,10 +170,10 @@ def source_bbn(self, source_bbn: FieldsContainer): support_data = source_bbn.get_support("control_parameter_1") support_properties = support_data.available_field_supported_properties() support_values = support_data.field_support_by_property(support_properties[0]) - if len(support_values) < 1: + if len(support_values) != len(source_bbn): raise PyAnsysSoundException( - "Control data in the specified broadband noise source must contain at least " - "one element." + "Broadband noise source must contain the same number of spectra and " + "associated control parameter values." ) self.__source_bbn = source_bbn diff --git a/tests/tests_sound_composer/test_sound_composer_source_broadband_noise.py b/tests/tests_sound_composer/test_sound_composer_source_broadband_noise.py index 013f6b3ec..c4f0a0eec 100644 --- a/tests/tests_sound_composer/test_sound_composer_source_broadband_noise.py +++ b/tests/tests_sound_composer/test_sound_composer_source_broadband_noise.py @@ -186,8 +186,8 @@ def test_source_broadband_noise_properties_exceptions(dpf_sound_test_server): with pytest.raises( PyAnsysSoundException, match=( - "Control data in the specified broadband noise source must contain at least one " - "element." + "Broadband noise source must contain the same number of spectra and associated " + "control parameter values." ), ): source_bbn_obj.source_bbn = fc_source_bbn