當前位置: 首頁>>代碼示例>>C#>>正文


C# AudioType類代碼示例

本文整理匯總了C#中AudioType的典型用法代碼示例。如果您正苦於以下問題:C# AudioType類的具體用法?C# AudioType怎麽用?C# AudioType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AudioType類屬於命名空間,在下文中一共展示了AudioType類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AudioClipInfo

 public AudioClipInfo(AudioType type, string resourcename, string systemname, float initvolume, int maxSEcount = 16 )
 {
     ResourceName = resourcename;
     if (type == AudioType.SE)
     {
         ResourcePath = SEPath + resourcename;
     }
     else if (type == AudioType.BGM) {
         ResourcePath = BGMPath + resourcename;
     }
     SystemName = systemname;
     MaxSECount = maxSEcount;
     PlayingList = new List<SEInfo>(maxSEcount);
     StockList = new SortedList<int, SEInfo>(maxSEcount);
     InitVolume = initvolume;
     AttenuateRate = calcAttenuateRate();
     //Debug.Log("Att: " + AttenuateRate);
     for (int i = 0; i < MaxSECount; i++) {
         //Debug.LogFormat("InitVol:{0}",InitVolume);
         SEInfo seinfo = new SEInfo(i, 0f, InitVolume * Mathf.Pow(AttenuateRate, i));
         //SEInfo seinfo = new SEInfo(i, 0f, InitVolume);
         StockList.Add(seinfo.Index, seinfo);
         //Debug.Log("Vol: " + seinfo.Volume);
     }
     Loop = null;
 }
開發者ID:sgmtjp,項目名稱:Git-SODATERUTOWER,代碼行數:26,代碼來源:SoundController.cs

示例2: PlayAudio

 public void PlayAudio(AudioType type)
 {
     foreach (var audio in AudioList.Where(audio => audio.type == type))
     {
         audio.Play();
     }
 }
開發者ID:TheWulo,項目名稱:DontDoIt,代碼行數:7,代碼來源:AudioManager.cs

示例3: Playlist

 /**
 // \fn public Playlist(int id, string name, string filename, AudioType type)
 //
 // \brief Constructor.
 //
 // \author Simon Menetrey
 // \date 26.05.2014
 //
 // \param id       The identifier.
 // \param name     The name.
 // \param filename Filename of the file.
 // \param type     The type.
 **/
 public Playlist(int id, string name, string filename, AudioType type)
 {
     this.Id = id;
     this.Name = name;
     this.Filename = filename;
     this.Type = type;
     this.AudioFileList = new List<string>();
 }
開發者ID:psymon75,項目名稱:WebradioManager,代碼行數:21,代碼來源:Playlist.cs

示例4: play

 public void play(AudioSource source, AudioType type)
 {
     if (canPlay (type)) {
         source.PlayOneShot (source.clip);
         audiosPlaying [type] = audiosPlaying [type] + 1;
         StartCoroutine (decrementAudiosPlaying (type, source.clip.length));
     }
 }
開發者ID:reqnux,項目名稱:reqnux_TillDeath,代碼行數:8,代碼來源:AudioManager.cs

示例5: LocalSong

 /// <summary>
 /// Initializes a new instance of the <see cref="LocalSong"/> class.
 /// </summary>
 /// <param name="path">The path of the file.</param>
 /// <param name="audioType">The audio type.</param>
 /// <param name="duration">The duration of the song.</param>
 public LocalSong(string path, AudioType audioType, TimeSpan duration)
     : base(path, audioType, duration)
 {
     if (this.IsRemovable)
     {
         this.StreamingPath = this.OriginalPath;
     }
 }
開發者ID:dineshkummarc,項目名稱:Espera,代碼行數:14,代碼來源:LocalSong.cs

示例6: VideoInfo

 private VideoInfo(int formatCode, VideoType videoType, int resolution, bool is3D, AudioType audioType, int audioBitrate)
 {
     this.FormatCode = formatCode;
     this.VideoType = videoType;
     this.Resolution = resolution;
     this.Is3D = is3D;
     this.AudioType = audioType;
     this.AudioBitrate = audioBitrate;
 }
開發者ID:remy22,項目名稱:Youtube_downloader,代碼行數:9,代碼來源:VideoInfo.cs

示例7: AudioBinary

 public AudioBinary(byte[] audioBytes, AudioType audioType)
 {
     if (audioBytes == null || audioBytes.Length < 1)
     {
         throw new InvalidOperationException("AudioBytes must contain values.");
     }
     AudioBytes = audioBytes;
     AudioType = audioType;
 }
開發者ID:hoelter,項目名稱:Salesforce-Meeting-Transcript,代碼行數:9,代碼來源:AudioBinary.cs

示例8: Audio

 public Audio(string name, string saveName, int matchScriptID)
 {
     Name = name;
     MatchScriptID = matchScriptID;
     SaveName = saveName;
     LengthMillis = AudioHelper.GetAudioLength(saveName);
     Length = AudioHelper.ConvertMillisToTime(LengthMillis);
     Type = AudioHelper.GetAudioType(saveName);
 }
開發者ID:oswellchan,項目名稱:PowerPointLabs,代碼行數:9,代碼來源:Audio.cs

示例9: VideoInfo

 private VideoInfo(int formatCode, VideoType videoType, int resolution, bool is3D, AudioType audioType, int audioBitrate)
 {
     FormatCode = formatCode;
     VideoType = videoType;
     Resolution = resolution;
     Is3D = is3D;
     AudioType = audioType;
     AudioBitrate = audioBitrate;
 }
開發者ID:changwng,項目名稱:MS.Youtube.Playlist.Downloader,代碼行數:9,代碼來源:VideoInfo.cs

示例10: AddNewData

        protected override int AddNewData()
        {
            m_audioType = DataManager.Generate<AudioType>();
            m_audioType.Name = m_textBox_name.Text;

            DataManager.AudioTypes.Add(m_audioType);

            return m_audioType.Id;
        }
開發者ID:ianeller-romey,項目名稱:CompJS_TTTD,代碼行數:9,代碼來源:UserControl_AudioType.cs

示例11: CreateSongMock

        public static Mock<Song> CreateSongMock(string name = "Song", bool callBase = false, AudioType audioType = AudioType.Mp3, TimeSpan? duration = null)
        {
            if (duration == null)
            {
                duration = TimeSpan.Zero;
            }

            return new Mock<Song>(name, audioType, duration) { CallBase = callBase };
        }
開發者ID:nemoload,項目名稱:Espera,代碼行數:9,代碼來源:Helpers.cs

示例12: YoutubeSong

        /// <summary>
        /// Initializes a new instance of the <see cref="YoutubeSong"/> class.
        /// </summary>
        /// <param name="path">The path of the song.</param>
        /// <param name="audioType">The audio type.</param>
        /// <param name="duration">The duration of the song.</param>
        /// <param name="isStreaming">if set to true, the song streams from YouTube, instead of downloading.</param>
        /// <exception cref="ArgumentNullException"><c>path</c> is null.</exception>
        public YoutubeSong(string path, AudioType audioType, TimeSpan duration, bool isStreaming)
            : base(path, audioType, duration)
        {
            this.IsStreaming = isStreaming;

            if (this.IsStreaming)
            {
                this.StreamingPath = this.OriginalPath;
            }
        }
開發者ID:dineshkummarc,項目名稱:Espera,代碼行數:18,代碼來源:YoutubeSong.cs

示例13: GetLatestAudioSource

    public static AudioSource GetLatestAudioSource( AudioType audioType )
    {
        GameObject audioLayer = GetAudioLayer( audioType );

        AudioSource[] audioSources = audioLayer.GetComponents<AudioSource>() as AudioSource[];

        if( audioSources.Length > 0 )
            return audioSources[ audioSources.Length - 1 ];

        return audioLayer.AddComponent("AudioSource") as AudioSource;
    }
開發者ID:nolanfilter,項目名稱:ProjectDeath,代碼行數:11,代碼來源:AudioAgent.cs

示例14: Play

 public static void Play( AudioClip clip, AudioType type )
 {
     if( type == AudioType.SFX ) {
         instance.audioSFX.PlayOneShot( clip, 1f);
     }
     else if( type == AudioType.Music && clip != instance.audioMusic.clip ) {
         instance.audioMusic.loop = true;
         instance.audioMusic.volume = 0.5f;
         instance.audioMusic.clip = clip;
         instance.audioMusic.Play();
     }
 }
開發者ID:PatriciaAE,項目名稱:FUTBOLITO,代碼行數:12,代碼來源:AudioManager.cs

示例15: IsMuted

	public static bool IsMuted (AudioType audioType) {
		switch (audioType) {
		case AudioType.FX:
			return SettingsUtil.FXMuted;
		case AudioType.Music:
			return SettingsUtil.MusicMuted;
		case AudioType.VO:
			return SettingsUtil.VOMuted;
		default:
			throw new System.Collections.Generic.KeyNotFoundException();
		}
	}
開發者ID:imann24,項目名稱:cs327-bestmobilegameever,代碼行數:12,代碼來源:AudioUtil.cs


注:本文中的AudioType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。