Ejemplo n.º 1
0
		/// <summary>
		/// Creates a new Sound Resource based on the specified AudioData, saves it and returns a reference to it.
		/// </summary>
		/// <param name="baseRes"></param>
		/// <returns></returns>
		public static ContentRef<Sound> CreateFromAudioData(ContentRef<AudioData> baseRes)
		{
			string resPath = PathHelper.GetFreePath(baseRes.FullName, FileExt);
			Sound res = new Sound(baseRes);
			res.Save(resPath);
			return res;
		}
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new Sound Resource based on the specified AudioData, saves it and returns a reference to it.
        /// </summary>
        /// <param name="baseRes"></param>
        /// <returns></returns>
        public static ContentRef <Sound> CreateFromAudioData(ContentRef <AudioData> baseRes)
        {
            string resPath = PathHelper.GetFreePath(baseRes.FullName, FileExt);
            Sound  res     = new Sound(baseRes);

            res.Save(resPath);
            return(res);
        }
Ejemplo n.º 3
0
		/// <summary>
		/// Creates a new Sound Resource based on the specified AudioData, saves it and returns a reference to it.
		/// </summary>
		/// <param name="baseRes"></param>
		/// <param name="name"></param>
		/// <returns></returns>
		public static ContentRef<Sound> CreateFromAudioData(IEnumerable<ContentRef<AudioData>> baseRes, string name = null)
		{
			if (!baseRes.Any()) return null;

			string basePath = baseRes.FirstOrDefault().FullName;
			if (name != null) basePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(basePath), name);

			string resPath = PathHelper.GetFreePath(basePath, FileExt);
			Sound res = new Sound(baseRes);
			res.Save(resPath);
			return res;
		}
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new Sound Resource based on the specified AudioData, saves it and returns a reference to it.
        /// </summary>
        /// <param name="baseRes"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static ContentRef <Sound> CreateFromAudioData(IEnumerable <ContentRef <AudioData> > baseRes, string name = null)
        {
            if (!baseRes.Any())
            {
                return(null);
            }

            string basePath = baseRes.FirstOrDefault().FullName;

            if (name != null)
            {
                basePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(basePath), name);
            }

            string resPath = PathHelper.GetFreePath(basePath, FileExt);
            Sound  res     = new Sound(baseRes);

            res.Save(resPath);
            return(res);
        }