コード例 #1
0
 private void AddFilter(AudioSource source)
 {
     if (_filter != null)
     {
         return;
     }
     _filter              = GetOrAddComponent <AudioCustomFilter>(source.gameObject);
     _filter.hideFlags    = HideFlags.HideInInspector;
     _filter.onAudioRead += SetData;
     source.Play();
 }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="source"></param>
        public AudioStreamTrack(AudioSource source)
            : this(Guid.NewGuid().ToString(), new AudioTrackSource())
        {
            if (source == null)
            {
                throw new ArgumentNullException("AudioSource argument is null.");
            }
            _source = source;

            _audioCapturer              = source.gameObject.AddComponent <AudioCustomFilter>();
            _audioCapturer.hideFlags    = HideFlags.HideInInspector;
            _audioCapturer.onAudioRead += SetData;
        }