开发者

Play sound file on Qt+Mac

开发者 https://www.devze.com 2023-03-03 07:19 出处:网络
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.

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

精彩评论

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