zoukankan      html  css  js  c++  java
  • DQ-SoundPlay

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using Microsoft.DirectX;
     6 using Microsoft.DirectX.DirectSound;
     7 using Microsoft.DirectX.AudioVideoPlayback;
     8 
     9 namespace DQ
    10 {
    11     class SoundPlay
    12     {
    13  
    14         public void SoundPlay_mp3(string spath)
    15         {
    16             Audio audio = new Audio(spath);
    17             audio.Play();
    18         }
    19         public void SoundPlay_wav(string spath)
    20         {
    21             Device GetDevice = new Device();
    22             GetDevice.SetCooperativeLevel((new Form_main()), CooperativeLevel.Priority);
    23             SecondaryBuffer snd = new SecondaryBuffer(spath, GetDevice);
    24             snd.Play(0, BufferPlayFlags.Looping);
    25         }
    26     }
    27 }
  • 相关阅读:
    数组
    JavaScript语法
    Math.random()
    第二第三周暑期集训总结
    第一周
    ACM课程学习总结
    专题四---总结
    专题四--1004
    专题四--1005
    专题四--1006
  • 原文地址:https://www.cnblogs.com/ddwk/p/8717100.html
Copyright © 2011-2022 走看看