文件名称:NAudioPractice1
-
所属分类:
- 标签属性:
- 上传时间:2017-04-07
-
文件大小:505kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
我参考官方示例简单封装了一个BSoundPlayer类,这个WAV播放类的特点:
1、简单易用,声明一个对象,指定文件路径,Play(),Stop()就可以了,支持调整音量,同时可以输出音频文件总时间,当前播放时间
2、同一个对象在播放完毕(或者手动停止)之前无法再次播放
3、不同对象可以同时播放
4、每次播放完毕,自动释放资源
这个类最大的缺点就是在播放结束之前不能再次播放,对于按钮快速点击声音这样的需求不能满足,但是可以用来播放时间比较长的背景音乐,与System.Media命名空间下的SoundPlayer类可以同时播放,配合System.Media命名空间下的SoundPlayer类用来做快速短暂的播放,基本可以满足游戏声音播放的需求了。-I refer to the official example of a simple package of a BSoundPlayer class, the characteristics of this WAV playback class:
1, easy to use, declare an object, specify the file path, Play (), Stop () on it, support to adjust the volume, and can output audio file total time, the current playback time
2, the same object can not be played again before playing (or manually stopped)
3, different objects can play at the same time
4, each time the playback is completed, the automatic release of resources
The biggest drawback of this class is that it can not be played again before the end of the play. The demand for a quick click on the button can not be met, but it can be used to play a long background music, and the SoundPlayer class under the System.Media namespace can be played at the same time , With the System.Media namespace under the SoundPlayer class used to do fast and short play, the basic can meet the needs of the game sound playback.
1、简单易用,声明一个对象,指定文件路径,Play(),Stop()就可以了,支持调整音量,同时可以输出音频文件总时间,当前播放时间
2、同一个对象在播放完毕(或者手动停止)之前无法再次播放
3、不同对象可以同时播放
4、每次播放完毕,自动释放资源
这个类最大的缺点就是在播放结束之前不能再次播放,对于按钮快速点击声音这样的需求不能满足,但是可以用来播放时间比较长的背景音乐,与System.Media命名空间下的SoundPlayer类可以同时播放,配合System.Media命名空间下的SoundPlayer类用来做快速短暂的播放,基本可以满足游戏声音播放的需求了。-I refer to the official example of a simple package of a BSoundPlayer class, the characteristics of this WAV playback class:
1, easy to use, declare an object, specify the file path, Play (), Stop () on it, support to adjust the volume, and can output audio file total time, the current playback time
2, the same object can not be played again before playing (or manually stopped)
3, different objects can play at the same time
4, each time the playback is completed, the automatic release of resources
The biggest drawback of this class is that it can not be played again before the end of the play. The demand for a quick click on the button can not be met, but it can be used to play a long background music, and the SoundPlayer class under the System.Media namespace can be played at the same time , With the System.Media namespace under the SoundPlayer class used to do fast and short play, the basic can meet the needs of the game sound playback.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
NAudioPractice1
...............\NAudioPractice1
...............\NAudioPractice1.sln
...............\NAudioPractice1.suo
...............\...............\bin
...............\...............\...\Debug
...............\...............\...\.....\ClickSound1.wav
...............\...............\...\.....\NAudio.dll
...............\...............\...\.....\NAudioPractice1.exe
...............\...............\...\.....\NAudioPractice1.pdb
...............\...............\...\.....\NAudioPractice1.vshost.exe
...............\...............\...\.....\NAudioPractice1.vshost.exe.manifest
...............\...............\...\.....\OpenDoorSound.wav
...............\...............\BSoundPlayer.cs
...............\...............\Form1.cs
...............\...............\Form1.Designer.cs
...............\...............\Form1.resx
...............\...............\NAudioPractice1.csproj
...............\...............\obj
...............\...............\...\x86
...............\...............\...\...\Debug
...............\...............\...\...\.....\DesignTimeResolveAssemblyReferences.cache
...............\...............\...\...\.....\DesignTimeResolveAssemblyReferencesInput.cache
...............\...............\...\...\.....\NAudioPractice1.csproj.FileListAbsolute.txt
...............\...............\...\...\.....\NAudioPractice1.csproj.GenerateResource.Cache
...............\...............\...\...\.....\NAudioPractice1.csprojResolveAssemblyReference.cache
...............\...............\...\...\.....\NAudioPractice1.exe
...............\...............\...\...\.....\NAudioPractice1.Form1.resources
...............\...............\...\...\.....\NAudioPractice1.pdb
...............\...............\...\...\.....\NAudioPractice1.Properties.Resources.resources
...............\...............\...\...\.....\TempPE
...............\...............\Program.cs
...............\...............\Properties
...............\...............\..........\AssemblyInfo.cs
...............\...............\..........\Resources.Designer.cs
...............\...............\..........\Resources.resx
...............\...............\..........\Settings.Designer.cs
...............\...............\..........\Settings.settings
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.