本文整理汇总了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;
}
示例2: PlayAudio
public void PlayAudio(AudioType type)
{
foreach (var audio in AudioList.Where(audio => audio.type == type))
{
audio.Play();
}
}
示例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>();
}
示例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));
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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 };
}
示例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;
}
}
示例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;
}
示例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();
}
}
示例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();
}
}