这是我的directshow图:
捕获源 – > LAME AUdio ENCODER(音频压缩器) – > WAV DEST(Wave muxer,从SDK sourcres编译) – >文件编写者.
问题是我想以编程方式配置编码器(比特率,通道,VBR / CBR等),而不是使用LAME编码器上可用的属性页(ISpecifyPropertyPages).
检索LAME源后,似乎必须使用特定的IAudioEncoderPropertIEs接口完成配置.
我尝试使用此声明在我的.NET应用程序中封送此COM接口:
[Comimport] [SuppressUnmanagedCodeSecurity] [InterfaceType(ComInterfaceType.InterfaceIsIUnkNown)] [GuID("ca7e9ef0-1cbe-11d3-8d29-00a0c94bbfee")] public interface IAudioEncoderPropertIEs { // Get target compression bitrate in Kbits/s int get_Bitrate(out int DWBitrate); // Set target compression bitrate in Kbits/s // Not all numbers available! See spec for details! int set_Bitrate(int DWBitrate); }
请注意,并非所有方法都已重新定义.
我可以使用以下方法成功构建我的音频压缩器滤波器(LAME编码器):
IAudioEncoderPropertIEs prop = mp3Filter as AudioEncoderPropertIEs;
但是当我调用get_Bitrate方法时,返回的值为0,并且调用set_Bitrate方法似乎没有输出文件.
我尝试使用属性页面配置我的过滤器,它的工作原理.
所以,我想知道是否有人已经将LAME编码器用于DirectShow应用程序(无论是否为.NET)并且可以给我一些帮助?
问候.
–
Sypher
[Comimport][SuppressUnmanagedCodeSecurity][InterfaceType(ComInterfaceType.InterfaceIsIUnkNown)][GuID("ca7e9ef0-1cbe-11d3-8d29-00a0c94bbfee")]public interface IAudioEncoderPropertIEs{ /// <summary> /// Is PES output enabled? Return TRUE or FALSE /// </summary> int get_PESOutputEnabled([Out] out int DWEnabled); /// <summary> /// Enable/disable PES output /// </summary> int set_PESOutputEnabled([In] int DWEnabled); /// <summary> /// Get target compression bitrate in Kbits/s /// </summary> int get_Bitrate([Out] out int DWBitrate); /// <summary> /// Set target compression bitrate in Kbits/s /// Not all numbers available! See spec for details! /// </summary> int set_Bitrate([In] int DWBitrate); ///... the rest of interface}总结
以上是内存溢出为你收集整理的c# – 使用IAudioEncoderProperties在DirectShow应用程序中配置LAME MP3编码器全部内容,希望文章能够帮你解决c# – 使用IAudioEncoderProperties在DirectShow应用程序中配置LAME MP3编码器所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)