使用本机系统调用在C ++中播放声音? [英] Playing sound in C++ using native system calls?

查看:291
本文介绍了使用本机系统调用在C ++中播放声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此在Windows中,您可以使用 PlaySound 函数在C ++应用程序中播放MP3文件。什么是一些类似的功能可用于Mac OS X / Linux?如果您可以链接到一些演示此操作的示例Hello-World类型程序,我也非常感谢。

So in Windows, you can use the PlaySound function to play an MP3 file in a C++ application. What would be some similar functions available for use in Mac OS X/Linux? I would also appreciate it if you could link to some sample Hello-World type programs demonstrating this.

推荐答案

c $ c> open(/ dev / dsp)并写入它。这是本地系统调用,你可以得到,我相信。

You can just open("/dev/dsp") and write to it. That's as "native syscall" as you can get, I believe.

这篇关于使用本机系统调用在C ++中播放声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆