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

            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}");
                }
            }
        }