示例#1
0
 public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool stream, PCMReaderCallback pcmreadercallback, PCMSetPositionCallback pcmsetpositioncallback)
 {
     if (name == null)
     {
         throw new NullReferenceException();
     }
     if (lengthSamples <= 0)
     {
         throw new ArgumentException("Length of created clip must be larger than 0");
     }
     if (channels <= 0)
     {
         throw new ArgumentException("Number of channels in created clip must be greater than 0");
     }
     if (frequency <= 0)
     {
         throw new ArgumentException("Frequency in created clip must be greater than 0");
     }
     AudioClip clip = Construct_Internal();
     if (pcmreadercallback != null)
     {
         clip.m_PCMReaderCallback = (PCMReaderCallback) Delegate.Combine(clip.m_PCMReaderCallback, pcmreadercallback);
     }
     if (pcmsetpositioncallback != null)
     {
         clip.m_PCMSetPositionCallback = (PCMSetPositionCallback) Delegate.Combine(clip.m_PCMSetPositionCallback, pcmsetpositioncallback);
     }
     clip.Init_Internal(name, lengthSamples, channels, frequency, stream);
     return clip;
 }
        // Creates a user AudioClip with a name and with the given length in samples, channels and frequency.
        public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool stream, PCMReaderCallback pcmreadercallback, PCMSetPositionCallback pcmsetpositioncallback)
        {
            if (name == null)
            {
                throw new NullReferenceException();
            }
            if (lengthSamples <= 0)
            {
                throw new ArgumentException("Length of created clip must be larger than 0");
            }
            if (channels <= 0)
            {
                throw new ArgumentException("Number of channels in created clip must be greater than 0");
            }
            if (frequency <= 0)
            {
                throw new ArgumentException("Frequency in created clip must be greater than 0");
            }

            AudioClip clip = Construct_Internal();

            if (pcmreadercallback != null)
            {
                clip.m_PCMReaderCallback += pcmreadercallback;
            }
            if (pcmsetpositioncallback != null)
            {
                clip.m_PCMSetPositionCallback += pcmsetpositioncallback;
            }

            clip.CreateUserSound(name, lengthSamples, channels, frequency, stream);

            return(clip);
        }
        /// *listonly*
        public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool stream, PCMReaderCallback pcmreadercallback)
        {
            AudioClip clip = Create(name, lengthSamples, channels, frequency, stream, pcmreadercallback, null);

            return(clip);
        }
 public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool _3D, bool stream, PCMReaderCallback pcmreadercallback, PCMSetPositionCallback pcmsetpositioncallback)
 {
     return(Create(name, lengthSamples, channels, frequency, stream, pcmreadercallback, pcmsetpositioncallback));
 }
		public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool _3D, bool stream, PCMReaderCallback pcmreadercallback, PCMSetPositionCallback pcmsetpositioncallback){}
示例#6
0
        public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool stream, PCMReaderCallback pcmreadercallback, PCMSetPositionCallback pcmsetpositioncallback)
        {
            if (name == null)
            {
                throw new NullReferenceException();
            }
            if (lengthSamples <= 0)
            {
                throw new ArgumentException("Length of created clip must be larger than 0");
            }
            if (channels <= 0)
            {
                throw new ArgumentException("Number of channels in created clip must be greater than 0");
            }
            if (frequency <= 0)
            {
                throw new ArgumentException("Frequency in created clip must be greater than 0");
            }
            AudioClip audioClip = Construct_Internal();

            if (pcmreadercallback != null)
            {
                AudioClip audioClip2 = audioClip;
                audioClip2.m_PCMReaderCallback = (PCMReaderCallback)Delegate.Combine(audioClip2.m_PCMReaderCallback, pcmreadercallback);
            }
            if (pcmsetpositioncallback != null)
            {
                AudioClip audioClip3 = audioClip;
                audioClip3.m_PCMSetPositionCallback = (PCMSetPositionCallback)Delegate.Combine(audioClip3.m_PCMSetPositionCallback, pcmsetpositioncallback);
            }
            audioClip.Init_Internal(name, lengthSamples, channels, frequency, stream);
            return(audioClip);
        }
示例#7
0
 public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool _3D, bool stream, PCMReaderCallback pcmreadercallback)
 {
     return Create(name, lengthSamples, channels, frequency, stream, pcmreadercallback, null);
 }