开发者

Play sound file on Qt+Mac

I need to play sounds under Qt with control of volume and panning. QSound doesn't do it, phonon may be too much for only this so I thought I'd try the native api.

eeermm, in Mac I have no idea, is there some simple interface to invoke on c++? (I've seen all this NSSound stuff but I am not familar with Objective C a开发者_JS百科nd I am not sure if it's possible to mix code (under QtCreator)) my idea would be to a module with simple native api calls to system features not found on Qt.

Thanks!


Qt AudioEngine in Qt5 will do this.

If you're using Qt4, making a single 'Objective-C++' file (extension .mm) which can be called from Qt, but makes NSFoo calls, is easy and works well. The header file should be plain C++, and everything will work together.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜