Example #1
0
        void createAudioProcessGraph()
        {
            graph = new AUGraph();

            var sampler = graph.AddNode(AudioComponentDescription.CreateMusicDevice(AudioTypeMusicDevice.Sampler));
            var inout   = graph.AddNode(AudioComponentDescription.CreateOutput(AudioTypeOutput.Remote));

            graph.Open();
            graph.ConnnectNodeInput(sampler, 0, inout, 0);

            samplerUnit = graph.GetNodeInfo(sampler);

            graph.Initialize();
            graph.Start();
        }
Example #2
0
        public Instrument(InstrumentInfo info, int channel, AUGraph graph, int ioNode)
        {
            Info = info;

            var samplerNode = graph.AddNode(AudioComponentDescription.CreateMusicDevice(AudioTypeMusicDevice.Sampler));

            graph.ConnnectNodeInput(samplerNode, 0, ioNode, (uint)channel);

            samplerUnit = graph.GetNodeInfo(samplerNode);
            samplerUnit.SetMaximumFramesPerSlice(4096, AudioUnitScopeType.Global, 0);

            this.channel = channel;

            LoadInstrument(info);
        }
        public static AudioComponent FindComponent(AudioTypeMusicDevice musicDevice)
        {
            var cd = AudioComponentDescription.CreateMusicDevice(musicDevice);

            return(FindComponent(ref cd));
        }