播放声音与C ++? [英] Playing sounds with C++?

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

问题描述

我将如何使它所以在我的计划有该按钮被点击一个按钮,我希望它发挥不开,媒体播放器.wma文件?

How would i make it so in my program there is a button when that button is clicked i want it to play a .wma file without opening and media player?

推荐答案

C ++标准不包含此功能。这意味着,它取决于你的系统提供什么。

The C++ standard does not include this functionality. That means it depends on what your system offers.

对于Windows,你可以尝试像 PlaySound

For Windows, you can try something like PlaySound.

不过,你最好的办法是使用pre-现有的库,如:

However, you best bet is to use a pre-existing library, like:

  • OpenAL
  • BASS
  • FMOD
  • SDL's: Sound.

谷歌搜索<一个href=\"http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=C%2B%2B%2BSound%2BLibrary\">C++声音图书馆带来了大量的信息。

Googling for C++ Sound Library brings up a lot of information.

此外,SO看看这些其他三个​​主题的:

Also, check out these three other SO topics:

  • What Is The Best C++ Sound API For Windows?
  • How to play MP3 files in C?
  • Learning to work with audio in C++

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

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