资源简介
新人写的代码。希望各位指教,不敢赚积分啦。没有找到免费下载,搞了个最低分,分享出来。
代码片段和文件信息
/* This class has been written by
* Corinna John (Hannover Germany)
* cj@binary-universe.net
*
* You may do with this code whatever you like
* except selling it or claiming any rights/ownership.
*
* Please send me a little feedback about what you‘re
* using this code for and what changes you‘d like to
* see in later versions. (And please excuse my bad english.)
*
* WARNING: This is experimental code.
* Please do not expect “Release Quality“.
* */
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace AviFile
{
public class AudioStream : AviStream{
public int CountBitsPerSample{
get{ return waveFormat.wBitsPerSample; }
}
public int CountSamplesPerSecond{
get{ return waveFormat.nSamplesPerSec; }
}
public int CountChannels{
get{ return waveFormat.nChannels; }
}
/// the stream‘s format
private Avi.PCMWAVEFORMAT waveFormat = new Avi.PCMWAVEFORMAT();
/// Initialize an AudioStream for an existing stream
/// The file that contains the stream
/// An IAVISTREAM from [aviFile]
public AudioStream(int aviFile IntPtr aviStream){
this.aviFile = aviFile;
this.aviStream = aviStream;
int size = Marshal.SizeOf(waveFormat);
Avi.AVIStreamReadFormat(aviStream 0 ref waveFormat ref size);
Avi.AVISTREAMINFO streamInfo = GetStreamInfo(aviStream);
}
/// Read the stream‘s header information
/// The IAVISTREAM to read from
/// AVISTREAMINFO
private Avi.AVISTREAMINFO GetStreamInfo(IntPtr aviStream){
Avi.AVISTREAMINFO streamInfo = new Avi.AVISTREAMINFO();
int result = Avi.AVIStreamInfo(aviStream ref streamInfo Marshal.SizeOf(streamInfo));
if(result != 0) {
throw new Exception(“Exception in AVIStreamInfo: “+result.ToString());
}
return streamInfo;
}
/// Read the stream‘s header information
/// AVISTREAMINFO
public Avi.AVISTREAMINFO GetStreamInfo(){
if(writeCompressed){
return GetStreamInfo(compressedStream);
}else{
return GetStreamInfo(aviStream);
}
}
/// Read the stream‘s format information
/// PCMWAVEFORMAT
public Avi.PCMWAVEFORMAT GetFormat(){
Avi.PCMWAVEFORMAT format = new Avi.PCMWAVEFORMAT();
int size = Marshal.SizeOf(format);
int result = Avi.AVIStreamReadFormat(aviStream 0 ref format ref size);
return format;
}
/// Returns all data needed to copy the stream
/// Do not forget to call Marshal.FreeHGlobal and release the raw data pointer
/// Receives the header information
/// Receives the format
/// Receives the length o
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-11-21 15:53 SyncChatClient\
目录 0 2017-11-21 15:53 SyncChatClient\.vs\
目录 0 2017-11-21 15:53 SyncChatClient\.vs\SyncChatClient\
目录 0 2017-11-21 15:53 SyncChatClient\.vs\SyncChatClient\v14\
文件 71680 2017-11-23 21:21 SyncChatClient\.vs\SyncChatClient\v14\.suo
目录 0 2017-11-23 21:21 SyncChatClient\SyncChatClient\
文件 189 2017-09-19 21:14 SyncChatClient\SyncChatClient\App.config
文件 4464 2017-11-02 20:14 SyncChatClient\SyncChatClient\AudioStream.cs
文件 12672 2017-11-13 14:45 SyncChatClient\SyncChatClient\Avi.cs
文件 14643 2017-11-02 20:14 SyncChatClient\SyncChatClient\AviManager.cs
文件 3626 2017-11-02 20:14 SyncChatClient\SyncChatClient\AviPla
文件 1093 2017-11-02 20:14 SyncChatClient\SyncChatClient\AviStream.cs
文件 5139 2017-11-02 20:14 SyncChatClient\SyncChatClient\EditableVideoStream.cs
文件 4799 2017-11-20 23:07 SyncChatClient\SyncChatClient\Form1.Designer.cs
文件 8868 2017-11-23 21:21 SyncChatClient\SyncChatClient\Form1.cs
文件 5817 2017-11-20 23:07 SyncChatClient\SyncChatClient\Form1.resx
文件 529 2017-09-19 21:29 SyncChatClient\SyncChatClient\Program.cs
目录 0 2017-11-21 15:53 SyncChatClient\SyncChatClient\Properties\
文件 2520 2004-06-13 18:26 SyncChatClient\SyncChatClient\Properties\AssemblyInfo.cs
文件 4464 2005-08-04 04:32 SyncChatClient\SyncChatClient\Properties\AudioStream.cs
文件 12672 2012-11-11 18:23 SyncChatClient\SyncChatClient\Properties\Avi.cs
文件 14643 2012-11-11 02:56 SyncChatClient\SyncChatClient\Properties\AviManager.cs
文件 3626 2004-12-18 05:59 SyncChatClient\SyncChatClient\Properties\AviPla
文件 1093 2004-12-18 06:01 SyncChatClient\SyncChatClient\Properties\AviStream.cs
文件 5139 2004-12-18 08:30 SyncChatClient\SyncChatClient\Properties\EditableVideoStream.cs
文件 2841 2017-09-19 21:14 SyncChatClient\SyncChatClient\Properties\Resources.Designer.cs
文件 5612 2017-09-19 21:14 SyncChatClient\SyncChatClient\Properties\Resources.resx
文件 1101 2017-09-19 21:14 SyncChatClient\SyncChatClient\Properties\Settings.Designer.cs
文件 249 2017-09-19 21:14 SyncChatClient\SyncChatClient\Properties\Settings.settings
文件 25282 2012-11-13 03:35 SyncChatClient\SyncChatClient\Properties\VideoStream.cs
文件 6056 2017-11-02 20:18 SyncChatClient\SyncChatClient\SyncChatClient.csproj
............此处省略32个文件信息
相关资源
- C#调用SynoAPIEx.dll接口采集指纹信息+绘
- C# 基于ModBus RTU获取气象站数据
- C#个人日程管理系统_程序设计报告(
- 单张相片后方交会计算程序C#
- C#读取惯导数据的简单
- C# 堆栈 回溯 马踏棋盘演示程序
- C# 数据结构——三元组与十字链表—
- modbus的C#
- C#写的员工管理信息系统,有C#完整项
- C# 标准偏差STDEV与CPK的计算
- C#实时窗口截图
- C#仿360加速球
- C# wpf combobox带treeview的自定义控件
-
C# Updatela
yeredWindow()编写桌面透明 - C# GIS算法演示:道格拉斯压缩、线性
- Rs232串口调试信息传输(C#)
- DirectShowLib,最新的DirectShowLib插件,提
- 布尔莎七参数求解__C#源码
- C#调用灵云TTS
- C#客服端与服务器通讯TcpClient和TcpLi
- C#TCP聊天室
- C# 将一个Treeview的树形结构保存成文件
- C#加载等待控件
- C#文本分割器源码
- C#实现声音录制
-
C#版本和ja
vasc ript版本的DES加密函 - c#写的winform超级记事本
- 处理图片背景色,使用透明C#&图片处
- C#DES标准ECB加密解密
- C#动态编译DLL到内存,并调用执行
评论
共有 条评论