Ejemplo n.º 1
0
        public UserAudioPlayer(Guid userID, AudioOutWPF parent, bool useWaveEvent = true)
        {
            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                new CompositionContainer(new AssemblyCatalog(Assembly.GetExecutingAssembly())).ComposeParts(this);
            }

            Parent       = parent;
            this.UserID  = userID;
            UseWaveEvent = useWaveEvent;

            User = UserStatusRepo.FindUser(userID);
            UserStatusRepo.Users.CollectionChanged += Users_CollectionChanged;

            aggregator = new FeenPhone.Audio.SampleAggregator()
            {
                PerformFFT = false
            };
            aggregator.NotificationCount = 882;
            aggregator.PerformFFT        = true;

            VisSource = new AudioVisualizationSource(aggregator);

            LastReceived = DateTime.UtcNow;
        }
Ejemplo n.º 2
0
        private IWavePlayer GetWavePlayer()
        {
            int desiredLatency = Math.Max(MinBufferedDurationMs, Math.Min((int)MaxBufferedDuration.TotalMilliseconds, BufferTarget));

            var SelectedOutput = Parent.SelectedOutput;

            Console.WriteLine("Initializing Output for {0} using {1}{2} with latency of {3}ms", User == null ? "<new user>" : User.Nickname ?? User.ID.ToString(), SelectedOutput.Provider, SelectedOutput.Provider == DeviceProvider.Wave && UseWaveEvent ? "Event" : "", desiredLatency);

            return(AudioOutWPF.InstanciateWavePlayerForOutput(SelectedOutput, desiredLatency, shareMode, UseWaveEvent));
        }