public void CreateAudioUnit()
        {
            TestRuntime.AssertXcodeVersion(7, 0);

            const string expectedManufacturer = "Apple";
            var          desc = new AudioComponentDescription {
                ComponentType = AudioComponentType.Output,
#if MONOMAC
#if NET
                ComponentSubType = AudioUnitSubType.VoiceProcessingIO,
#else
                ComponentSubType = (int)AudioUnitSubType.VoiceProcessingIO,
#endif
#else
#if NET
                ComponentSubType = (AudioUnitSubType)AudioTypeOutput.Remote,
#else
                ComponentSubType = 0x72696f63,                 // Remote_IO
#endif
#endif
                ComponentManufacturer = AudioComponentManufacturerType.Apple
            };

            using (var auFactory = new CustomAudioUnitFactory()) {
                NSError error;
                using (var audioUnit = auFactory.CreateAudioUnit(desc, out error)) {
                    Assert.True(audioUnit != null, "CustomAudioUnitFactory returned null object for valid component description");
                    Assert.True(audioUnit.ManufacturerName == expectedManufacturer,
                                $"CustomAudioUnitFactory returned audio unit with incorrect manufacturer. Expected - {expectedManufacturer}, actual - {audioUnit.ManufacturerName}");
                }
            }
        }
Exemple #2
0
        public void CreateAudioUnit()
        {
            if (!TestRuntime.CheckSystemAndSDKVersion(9, 0))
            {
                Assert.Ignore("Ignoring AudioUnitv3 tests: Requires iOS9+");
            }

            const string expectedManufacturer = "Apple";
            var          desc = new AudioComponentDescription {
                ComponentType = AudioComponentType.Output,
#if MONOMAC
                ComponentSubType = (int)AudioUnitSubType.VoiceProcessingIO,
#else
                ComponentSubType = 0x72696f63,                 // Remote_IO
#endif
                ComponentManufacturer = AudioComponentManufacturerType.Apple
            };

            using (var auFactory = new CustomAudioUnitFactory()) {
                NSError error;
                using (var audioUnit = auFactory.CreateAudioUnit(desc, out error)) {
                    Assert.True(audioUnit != null, "CustomAudioUnitFactory returned null object for valid component description");
                    Assert.True(audioUnit.ManufacturerName == expectedManufacturer,
                                $"CustomAudioUnitFactory returned audio unit with incorrect manufacturer. Expected - {expectedManufacturer}, actual - {audioUnit.ManufacturerName}");
                }
            }
        }