当前位置:网站首页>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
边栏推荐
- Mstp+vrrp+ospf implements a three-tier architecture
- “语法糖”——我的编程新知
- 【Harmony OS】【ARK UI】ETS 上下文基本操作
- [team learning] SQL programming language notes - task04
- JSP cannot be resolved to a type error reporting solution
- windows 2003 64位系统php运行报错:1% 不是有效的 win32 应用程序
- AI writes its own code to let agents evolve! The big model of openai has the flavor of "human thought"
- Cesium 加载显示热力图
- 练习:仿真模拟福彩双色球——中500w巨奖到底有多难?跑跑代码就晓得了。
- On the self-cultivation of an excellent red team member
猜你喜欢
cesium 图形标注圆形、正方形、多边形、椭圆等
数学分析_笔记_第3章:极限
练习:仿真模拟福彩双色球——中500w巨奖到底有多难?跑跑代码就晓得了。
Lu Qi invests in quantum computing for the first time
opencv怎么安装?opencv下载安装教程
Google founder brin's second marriage broke up: it was revealed that he had filed for divorce from his Chinese wife in January, and his current fortune is $631.4 billion
《Missing Parts》NFT 作品集第 5 系列上线 The Sandbox 市场平台
俄罗斯AIRI研究院等 | SEMA:利用深度迁移学习进行抗原B细胞构象表征预测
opencv是开源的吗?
DevEco Studio 3.0编辑器配置技巧篇
随机推荐
Maintenant, les oreilles vont entrer dans le métacosme.
Work assessment of pharmaceutical polymer materials of Jilin University in March of the 22nd spring -00025
Wuenda, the new course of machine learning is coming again! Free auditing, Xiaobai friendly
Perfect shuffle problem
Solution to the problem that Linux crontab timed operation Oracle does not execute (crontab environment variable problem)
Create SQLite table with shell script and add SQL statement -- General
如何使用IDE自动签名调试鸿蒙应用
Configuration source code
ZABBIX installation pit avoidance Guide
Crawler crawls Sina Weibo data
OpenSUSE environment variable settings
client-go gin的简单整合十一-Delete
Work assessment of Biopharmaceutics of Jilin University in March of the 22nd spring -00031
Hello CTP (II) -- Introduction to CTP
The more AI evolves, the more it resembles the human brain! Meta found the "prefrontal cortex" of the machine. AI scholars and neuroscientists were surprised
Oracle-sqlload import external data details
JS tool function, self encapsulating a throttling function
Peking University has a new president! Gongqihuang, academician of the Chinese Academy of Sciences, took over and was admitted to the Physics Department of Peking University at the age of 15
MySQL modifies and deletes tables in batches according to the table prefix
opencv怎么安装?opencv下载安装教程