当前位置:网站首页>acmStreamOpen返回值问题
acmStreamOpen返回值问题
2022-06-25 03:53:00 【微澜-】
说明:
第一次碰到这个函数已经是十多年前了,最近翻到后,感觉这东西挺有意思的,为什么当初没怎么使用,现在好像用的人也不多,调用了一下,不知道是不是多年后调用环境变了还是怎么,怎是返回512。于是就开始翻找答案。
了解这个函数,还是要想了解windows库中的msacm,这东西来自 Windows Multimedia,已经是超过20年的老技术了。通常被称为ACM(Audio Compression Manager,音频压缩管理器),它们负责管理系统中所有音频编解码器。只要在系统中注册号解码器就能使用acm解码,应用程序可以通过ACM或VCM提供的编程接口调用这些系统中现成的编解码器来实现音频或视频数据的压缩和解压缩。
使用acm时可以播放在系统中进行注册,转换驱动的任何格式的声音文件,如我的机器上有mp3格式的驱动并且拥有转换驱动,我就可以播放它。从官网上看,acm相关函数足够的多,功能也足够的强大,为什么不用呢?
遇到的问题:
acmStreamOpen 返回 512
把以前的老例子拿出来跑,枚举设备是没问题的,也找到了GSM之类的格式,然后录制了一段PCM(8000,1,8)的音频,想转为GSM,走到acmStreamOpen就卡了,怎么也走不下去,返回512。
到底是什么鬼?仔细看流程看不出来问题,返回值也没解释。网上搜吧,那都是N年前的老问题了,并且大都是没有后续的。
没有文档,没有例子,用的人少,似乎也只能卡住,对自己也没有啥意义,想说放弃算了。难道说历经20多年还能保留在windows库中的技术有问题,不像呀。
不过似乎也不是完全没有头绪,以前程序还是跑的,于是调整了函数调用顺序,发现acmStreamOpen返回了8,这里面有些看不见的坑。返回值8还是有说明的MMSYSERR_NOTSUPPORTED function isn't supported。这个东西有人遇到过,都说是格式错误,调整了下也就能过了。
把编码后的音频写入wav文件,进行播放,发现前面的几秒钟是静音,似乎转码也没那么正常,有时间再说吧。

总结:
MSACM这个东西对于初次接触的人很不友好,MSDN上只有函数说明没有怎么使用,而且封装的编解码函数返回值不明确,让人很是抓狂,网上大把的编解码库不是更直接吗?
这东西看上去强大,用起来也未必是好。
参考:
acmDriverOpen function (msacm.h) - Win32 apps | Microsoft Docs
关于:
qq:9611153 微信lgs9611153
边栏推荐
- 数学分析_笔记_第3章:极限
- [harmony OS] [ark UI] basic ETS context operations
- Deveco studio 3.0 editor configuration tips
- Development of trading system (V) -- Introduction to Sinovel counter
- 《悉达多》:一生之书,可以时常反刍
- Work assessment of pharmaceutical polymer materials of Jilin University in March of the 22nd spring -00025
- Hello CTP (I) - basic knowledge of futures
- Configuration source code
- X86 CPU, critical! The latest vulnerability has caused heated discussion. Hackers can remotely steal keys. Intel "all processors" are affected
- 【组队学习】SQL编程语言笔记——Task04
猜你喜欢
![[team learning] SQL programming language notes - task04](/img/3e/c75f5b4610c6b6700567fe75cd2339.png)
[team learning] SQL programming language notes - task04

Development of trading system (II) -- market data

Redis related-01

威马招股书拆解:电动竞争已结束,智能排位赛刚开始

居家办公之后才明白的时间管理 | 社区征文

如何使用IDE自动签名调试鸿蒙应用

严重的PHP缺陷可导致QNAP NAS 设备遭RCE攻击

Mstp+vrrp+ospf implements a three-tier architecture
![[rust submission] review impl trail and dyn trail in rust](/img/bc/05b3e031659ce19d6f6e3887d70512.jpg)
[rust submission] review impl trail and dyn trail in rust

opencv怎么安装?opencv下载安装教程
随机推荐
Deveco studio 3.0 editor configuration tips
OpenSUSE installation pit log
Hello CTP (V) -- CTP position calculation
Development of trading system (x) -- fix agreement
Windows 2003 64 bit system PHP running error: 1% is not a valid Win32 Application
完美洗牌问题
JS tool function, self encapsulating a throttling function
opencv是开源的吗?
Lao Ye's blessing
Jilin University 22 spring March "official document writing" assignment assessment-00029
About PLSQL error initialization failure
Disassembly of Weima prospectus: the electric competition has ended and the intelligent qualifying has just begun
opencv 红色区域在哪里?
How to use ide to automatically sign and debug Hongmeng application
Redis related-03
X86 CPU, critical! The latest vulnerability has caused heated discussion. Hackers can remotely steal keys. Intel "all processors" are affected
Do you really need automated testing?
【Proteus仿真】Arduino UNO按键控制数码管闪烁增/减显示
Jilin University 22 spring March new development English comprehensive course (I) assignment assessment-00080
Preparedstatement principle of preventing SQL injection