• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Audio类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Audio的典型用法代码示例。如果您正苦于以下问题:C# Audio类的具体用法?C# Audio怎么用?C# Audio使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Audio类属于命名空间,在下文中一共展示了Audio类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Search

        public void Search(List<Audio> source, Audio referenceItem, object parameters = null)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            if (referenceItem == null)
            {
                throw new ArgumentNullException("referenceItem");
            }

            Tempogram Descriptor = referenceItem.GetData<Tempogram>();

            if (Descriptor != null)
            {
                foreach (var Target in source)
                {
                    Tempogram Tempogram = Target.GetData<Tempogram>();
                    if (Tempogram == null)
                    {
                        Target.Tag = 10;
                        continue;
                    }

                    var d1 = Descriptor.LongTempogram.Distance(Tempogram.LongTempogram);
                    var d2 = Descriptor.ShortTempogram.Distance(Tempogram.ShortTempogram);
                    var d3 = Math.Abs(Descriptor.Intensity - Tempogram.Intensity);
                    Target.Tag = d1 + d2 * 0.0003f + d3 * 0.0002f;
                }
            }

            source.Sort((a1, a2) => a1.Tag.CompareTo(a2.Tag));
        }
开发者ID:skorpioniche,项目名称:Iplayer,代码行数:34,代码来源:SearchByTempoDistribution.cs


示例2: button1_Click

        //select a song
        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Stop();
            timer2.Stop();

            OpenFileDialog dlg = new OpenFileDialog();
            dlg.ShowDialog();
            song_path = dlg.FileName.ToString();
            textBox1.Text = song_path;
            try
            {

                song.Stop();
            }
            catch (Exception ex) { }

            try
            {
                song = new Audio(song_path);
                timer1.Interval = (int)(song.Duration * 10);
                progressBar1.Value = 0;
                //MessageBox.Show(timer1.Interval.ToString());
            }
            catch (Exception ex) { }
        }
开发者ID:githubdemo,项目名称:Voice-controlled-MP3-Player,代码行数:26,代码来源:HomeScreen.cs


示例3: Interrupt

 public void Interrupt(Songs p_song)
 {
     this.audio.Stop();
     this.audio = new Audio(Utility.FindMediaFile(@"\Music\" + p_song.ToString() + ".mp3"));
     this.audio.Volume = -500;
     this.interupted = true;
 }
开发者ID:maestun,项目名称:wonderboy,代码行数:7,代码来源:Music.cs


示例4: AudioVisualizationSource

        public AudioVisualizationSource(Audio.SampleAggregator aggregator)
        {
            this.aggregator = aggregator;

            MaximumCalculated += new EventHandler<MaxSampleEventArgs>(audioGraph_MaximumCalculated);
            FftCalculated += new EventHandler<FftEventArgs>(audioGraph_FftCalculated);
        }
开发者ID:stevenzeiler,项目名称:FeenPhone,代码行数:7,代码来源:AudioVisualizationSource.cs


示例5: AddAudioPickupSource

 public Entity AddAudioPickupSource(Audio[] newClips, bool newRandomizePitch)
 {
     var component = CreateComponent<AudioPickupSourceComponent>(ComponentIds.AudioPickupSource);
     component.clips = newClips;
     component.randomizePitch = newRandomizePitch;
     return AddComponent(ComponentIds.AudioPickupSource, component);
 }
开发者ID:JamesMcMahon,项目名称:entitas-2d-roguelike,代码行数:7,代码来源:AudioPickupSourceComponentGeneratedExtension.cs


示例6: AddAudioDocument

 private static void AddAudioDocument(string[] attributes)
 {
     Dictionary<string, string> attr = getDictAttr(attributes);
     string documentName = returnNameCmdValue(attr);
     if (documentName != null)
     {
         Audio newDoc = new Audio(documentName);
         documents.Add(newDoc);
         Console.WriteLine("Document added: " + documentName);
         foreach (var key in attr.Keys)
         {
             switch (key)
             {
                 case "content":
                     newDoc.Content = attr[key];
                     break;
                 case "samplerate":
                     newDoc.SampleRateHz = attr[key];
                     break;
                 case "length":
                     newDoc.LengthInSeconds = attr[key];
                     break;
                 case "size":
                     newDoc.SizeInBytes = attr[key];
                     break;
             }
         }
     }
 }
开发者ID:jamaldt,项目名称:telerikacademy,代码行数:29,代码来源:DocumentSystem.cs


示例7: Dispose

 public virtual void Dispose()
 {
     m_Audio.Stop();
     m_Audio.Dispose();
     m_Audio = null;
     m_Disposed = true;
 }
开发者ID:unk1nd,项目名称:US_AirForce,代码行数:7,代码来源:Engine_Music.cs


示例8: MainWindow

        public MainWindow()
        {
            InitializeComponent();
            string filename = @"C:\Users\Joe\Documents\fftmusic\music\WpfApplication1\Jupiter.wav";//openFile("Select Audio (wav) file");
            //string xmlfile = "C:\\Users\\Joe\\Documents\\fftmusic\\music\\WpfApplication1\\Jupiter.xml";// openFile("Select Score (xml) file");
            file = new Audio(filename);
            //Thread check = new Thread(new ThreadStart(updateSlider));
            loadWave(filename);
            int trials = 20;
            while (trials --> 0)
            {
                freqDomain();
            }
            //sheetmusic = readXML(xmlfile);
            //onsetDetection();
            //loadImage();
            //loadHistogram();
            //playBack();
            //check.Start();

            //button1.Click += zoomIN;
            //button2.Click += zoomOUT;

            //slider1.ValueChanged += updateHistogram;
            //playback.PlaybackStopped += closeMusic;
        }
开发者ID:Dvorak-the-Explorak,项目名称:music,代码行数:26,代码来源:MainWindow.xaml.cs


示例9: SoundAlarm

        public SoundAlarm(string mp3FileName, string fadeInMinutes, string fadeOutMinutes, 
            string durationMinutes, string fromTime, string toTime, string snoozeTime, string alarmCue)
        {
            this.fadeInSeconds = (int)TimeSpan.Parse("00:" + fadeInMinutes).TotalSeconds; // 00 hours
            this.fadeOutSeconds = (int)TimeSpan.Parse("00:" + fadeOutMinutes).TotalSeconds; // 00 hours
            this.durationSeconds = (int)TimeSpan.Parse("00:" + durationMinutes).TotalSeconds; // 00 hours
            this.fromTime = fromTime;
            this.toTime = toTime;
            this.snoozeTime = snoozeTime;

            if (string.IsNullOrEmpty(this.fromTime) == true)
            {
                this.AlarmEnabled = true;
            }

            this.AlarmStarted = false;
            this.stopWatch = new Stopwatch();
            this.audio = new Audio(mp3FileName, false);
            this.audio.Volume = SoundAlarm.MinVolume;
            this.audio.Ending += new EventHandler(this.Audio_Ending);

            this.sleepStages = new List<ZeoSleepStage>();

            this.ParseAlarmCue(alarmCue);
        }
开发者ID:andrewjbennett,项目名称:ZeoScope,代码行数:25,代码来源:SoundAlarm.cs


示例10: _ouvrir

        public string _ouvrir(typeFichier tf)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            if (tf == typeFichier.musique)
            {
                ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
                ofd.Filter = "mp3 files (*.mp3)|*.mp3";
                ofd.FilterIndex = 2;
                ofd.RestoreDirectory = true;

                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    if (ofd.OpenFile() != null)
                    {
                        try
                        {
                            Lecteur = new Audio(ofd.FileName, false);

                        }
                        catch (Exception esx)
                        {
                            MessageBox.Show("Fichier non reconnu." + esx.HResult);
                            return null;
                        }

                        return ofd.FileName;

                    }
                }
                return null;
            }
            else if (tf == typeFichier.image)
            {
                ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
                ofd.Filter = "JPG (*.jpg)|*.jpg";
                ofd.FilterIndex = 2;
                ofd.RestoreDirectory = true;

                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        if (ofd.OpenFile() != null)// On attribue le chemin du fichier à lire au
                        {

                            return ofd.FileName;

                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
                        return null;
                    }
                }
                return null;

            }
            return null;
        }
开发者ID:joanny,项目名称:Lecteur_mp3,代码行数:60,代码来源:ControleLecture.cs


示例11: MainWindow

        // public static Time ttt = new Time();
        public MainWindow()
        {
            // ttt.reset();
            InitializeComponent();
            string filename = openFile("Select Audio (wav) file");
            string xmlfile = openFile("Select Score (xml) file");
            Time timer = new Time();
            file = new Audio(filename);
            timer.next("Load Audio");
            Thread check = new Thread(new ThreadStart(updateSlider));
            timer.next("slider thread");
            loadWave(filename);
            timer.next("setup");
            freqDomain();
            timer.next("freqDomain");
            sheetmusic = readXML(xmlfile);
            timer.next("sheetmusic");
            onsetDetection();
            timer.next("onsetDetection");
            loadImage();
            timer.next("loadImage");
            loadHistogram();
            timer.next("loadHistogram");
            playBack();
            timer.next("playBack");
            check.Start();

            button1.Click += zoomIN;
            button2.Click += zoomOUT;

            slider1.ValueChanged += updateHistogram;
            playback.PlaybackStopped += closeMusic;
            timer.end("Other stuff");
               // ttt.end("fft total");
        }
开发者ID:dittopower,项目名称:INB375-Parallel-Computing,代码行数:36,代码来源:MainWindow.xaml.cs


示例12: AddAudioPickupSource

 public Entity AddAudioPickupSource(Audio[] newClips, bool newRandomizePitch)
 {
     var component = _audioPickupSourceComponentPool.Count > 0 ? _audioPickupSourceComponentPool.Pop() : new AudioPickupSourceComponent();
     component.clips = newClips;
     component.randomizePitch = newRandomizePitch;
     return AddComponent(ComponentIds.AudioPickupSource, component);
 }
开发者ID:NotYours180,项目名称:entitas-2d-roguelike,代码行数:7,代码来源:AudioPickupSourceComponentGeneratedExtension.cs


示例13: Main

    /** The entry point of the program. It controls the initialisation and defines the main game loop. */
    static void Main()
    {
        //Temporary solution to set the resource directory:
        System.IO.Directory.SetCurrentDirectory("..\\..\\res");

        //Initialise subsystems
        video = new Video();
        audio = new Audio();
        world = new World();
        input = new Input();

        ScriptManager.initialiseFromScript("configure.lua", video, audio, world, input);

        //Main loop
        while (world.running)
        {
            world.beforeInput();

            handleEvents();
            input.startFrame();

            world.afterInput();

            video.draw(world);
            audio.play(world);

            world.AfterLoop();
            input.endFrame();
        }

        world.Dispose();
        audio.Dispose();
        video.Dispose();
    }
开发者ID:lightofanima,项目名称:Polys,代码行数:35,代码来源:Program.cs


示例14: Main

    static void Main()
    {
        // Play a sound with the Audio class:
        Audio myAudio = new Audio();
        Console.WriteLine("Playing sound...");
        myAudio.Play(@"c:\WINDOWS\Media\chimes.wav");

        // Display time information with the Clock class:
        Clock myClock = new Clock();
        Console.Write("Current day of the week: ");
        Console.WriteLine(myClock.LocalTime.DayOfWeek);
        Console.Write("Current date and time: ");
        Console.WriteLine(myClock.LocalTime);

        // Display machine information with the Computer class:
        Computer myComputer = new Computer();
        Console.WriteLine("Computer name: " + myComputer.Name);

        if (myComputer.Network.IsAvailable)
        {
            Console.WriteLine("Computer is connected to network.");
        }
        else
        {
            Console.WriteLine("Computer is not connected to network.");
        }
    }
开发者ID:terryjintry,项目名称:OLSource1,代码行数:27,代码来源:how-to--use-the-my-namespace--csharp-programming-guide-_2.cs


示例15: Dispose

 public static void Dispose()
 {
     if (m_Audio != null)
     {
         m_Audio.Dispose();
     }
     m_Audio = null;
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:8,代码来源:Music.cs


示例16: ReplaceAudioWalkSource

 public Entity ReplaceAudioWalkSource(Audio[] newClips, bool newRandomizePitch)
 {
     var component = CreateComponent<AudioWalkSourceComponent>(ComponentIds.AudioWalkSource);
     component.clips = newClips;
     component.randomizePitch = newRandomizePitch;
     ReplaceComponent(ComponentIds.AudioWalkSource, component);
     return this;
 }
开发者ID:JamesMcMahon,项目名称:entitas-2d-roguelike,代码行数:8,代码来源:AudioWalkSourceComponentGeneratedExtension.cs


示例17: OnAudio

 internal static void OnAudio(IFeenPhoneNetstate state, Guid userID, Audio.Codecs.CodecID Codec, byte[] data, int dataLen)
 {
     foreach (var feen in AllFeens)
         if (feen != state.Notifier && state.User != null)
             feen.OnAudio(userID, Codec, data, dataLen);
     if (ServerHost.LocalClient != null && ServerHost.LocalClient != state)
         ServerHost.LocalClient.Notifier.OnAudio(userID, Codec, data, dataLen);
 }
开发者ID:stevenzeiler,项目名称:FeenPhone,代码行数:8,代码来源:EventSink.cs


示例18: toFinal

 public void toFinal(Audio qMusic, Audio qFinal, int qNumber)
 {
     if (qMusic.Playing == true && qNumber > 5) qMusic.Stop();
     qFinal.Play();
     ansLabel.ForeColor = Color.Black;
     ansPic.Image = Form3.getPictureRes(ansLetter + "_final");
     ansIfLocked = true;
 }
开发者ID:Armandos95,项目名称:OldMillionaireApp,代码行数:8,代码来源:Answer.cs


示例19: Dispose

 public void Dispose()
 {
     if (mAudio != null)
     {
         mAudio.Dispose();
     }
     mAudio = null;
 }
开发者ID:zhuangyy,项目名称:Motion,代码行数:8,代码来源:DirectXPlayer.cs


示例20: MyObjectiveGetToLocations

 public MyObjectiveGetToLocations(StringBuilder Name, MyMissionID ID, StringBuilder Description, MyTexture2D Icon, MyMission ParentMission, MyMissionID[] RequiredMissions, List<MyMissionLocation> DummiesToVisit, Audio.Dialogues.MyDialogueEnum? successDialogId = null, Audio.Dialogues.MyDialogueEnum? startDialogId = null, bool displayObjectivesCount = true) :
     base(Name, ID, Description, Icon, ParentMission, RequiredMissions, null, null, successDialogId, startDialogId, displayObjectivesCount)
 {
     Debug.Assert(DummiesToVisit != null);
     Debug.Assert(DummiesToVisit.Count > 0);
     m_dummiesToVisit = DummiesToVisit;
     m_dummiesVisited = new List<MyMissionLocation>();
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyObjectiveGetToLocations.cs



注:本文中的Audio类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AudioClientShareMode类代码示例发布时间:2022-05-24
下一篇:
C# AttributesMappingManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap