fmod

Qt编写自定义控件60-声音波形图

早过忘川 提交于 2019-11-28 18:15:19
一、前言 这个控件源自于一个音乐播放器,在写该音乐播放器的时候,需要将音频的数据转换成对应的频谱显示,采用的fmod第三方库来处理(fmod声音系统是为游戏开发者准备的革命性音频引擎,非常强大和牛逼),fmod负责拿到音频数据对应的采样频谱数据,然后传给这个控件进行绘制即可,本控件主需要专注于绘制即可,这样fmod对应封装的类专注于音频采集等处理,实现了隔离,修改和增加功能比较方便,声音波形图控件除了可以设置采样的深度以外,还支持三种数据样式展示,线条样式、柱状样式、平滑样式。为了可以直接定位到某一位置直接跳转到音频位置,还增加了绘制数线条定位线。 二、实现的功能 1:可设置采样深度 2:可设置当前位置线条宽度/线条颜色 3:可设置前景色/背景色 4:可设置数据展示样式,线条样式/柱状样式/平滑样式 三、效果图 四、头文件代码 #ifndef WAVEDATA_H #define WAVEDATA_H /** * 音量采样值波形控件 作者:feiyangqingyun(QQ:517216493) 2017-9-10 * 1:可设置采样深度 * 2:可设置当前位置线条宽度/线条颜色 * 3:可设置前景色/背景色 * 4:可设置数据展示样式,线条样式/柱状样式/平滑样式 */ #include <QWidget> #ifdef quc #if (QT_VERSION < QT

C++:Undefined reference to 'FMOD:: X'

…衆ロ難τιáo~ 提交于 2019-11-28 12:55:34
After looking around for various sound API libraries, I have decided to use FMOD for the time being. Problem is that whenever I try to compile one of the code examples, I get the following errors: obj\Release\main.o:main.cpp|| undefined reference to `FMOD::System::getVersion(unsigned int*)@8'| obj\Release\main.o:main.cpp|| undefined reference to `FMOD::System::init(int, unsigned int, void*)@16'| obj\Release\main.o:main.cpp|| undefined reference to `FMOD::System::createSound(char const*, unsigned int, FMOD_CREATESOUNDEXINFO*, FMOD::Sound**)@20'| obj\Release\main.o:main.cpp|| undefined reference

Callback delegates being collected?

梦想与她 提交于 2019-11-28 11:56:42
Been messing around with FMOD for C# game development and I've hit a snag early on that I can't seem to get around. I want to do some branching audio stuff and sync some gameplay action to beats and such, so I've tried adding syncpoints to my music tracks. Here's code: public class Music { private Sound music; private Channel channel; private IntPtr syncPtr; public string File { get; private set; } public Music(string file) { File = file; } public void Load() { music = new Sound(); Audio.System.createSound(File, MODE.HARDWARE, ref music); } public void Unload() { music.release(); } public

C API function callbacks into C++ member function code

谁都会走 提交于 2019-11-28 11:08:08
So, I'm using the FMOD api and it really is a C api. Not that that's bad or anything. Its just it doesn't interface well with C++ code. For example, using FMOD_Channel_SetCallback( channel, callbackFunc ) ; It wants a C-style function for callbackFunc , but I want to pass it a member function of a class. I ended up using the Win32 trick for this, making the member function static. It then works as a callback into FMOD. Now I have to hack apart my code to make some of the members static, just to account for FMOD's C-ness. I wonder if its possible in FMOD or if there's a work around to link up

Using an embedded .dll in an executable

一笑奈何 提交于 2019-11-28 02:07:39
问题 Okay. So I know there's lots of questions about how to embed dlls inside exes, but my problem is rather different. (Specifically, I'm using the fmod library to play sounds in my program, and I'm embedding the fmod.dll, but that's beside the point.) I am using Visual C++ 2010 Ultimate. I have successfully embedded the .dll inside the .exe. My resources.h file contains #define IDR_DLL1 144 and my .rc file contains IDR_DLL1 DLL MOVEABLE PURE "data\\fmod.dll" I have the following function in my

Callback delegates being collected?

坚强是说给别人听的谎言 提交于 2019-11-27 06:37:16
问题 Been messing around with FMOD for C# game development and I've hit a snag early on that I can't seem to get around. I want to do some branching audio stuff and sync some gameplay action to beats and such, so I've tried adding syncpoints to my music tracks. Here's code: public class Music { private Sound music; private Channel channel; private IntPtr syncPtr; public string File { get; private set; } public Music(string file) { File = file; } public void Load() { music = new Sound(); Audio

C API function callbacks into C++ member function code

空扰寡人 提交于 2019-11-27 05:58:09
问题 So, I'm using the FMOD api and it really is a C api. Not that that's bad or anything. Its just it doesn't interface well with C++ code. For example, using FMOD_Channel_SetCallback( channel, callbackFunc ) ; It wants a C-style function for callbackFunc , but I want to pass it a member function of a class. I ended up using the Win32 trick for this, making the member function static. It then works as a callback into FMOD. Now I have to hack apart my code to make some of the members static, just