Tony Rietwyk Tony Rietwyk - 1 year ago 89
C++ Question

How to increase the volume in the OSX PlaySoftMidi example.

I have an application written in C++ and the Qt cross-platform library. It uses QuickTime on OSX to play midi events. On OSX 10.6 it works OK. On OSX 10.7 (Lion), the volume of the midi is really low. Increasing the system volume is not an option, since the same app plays audio as well, and that ends up being too loud. I've searched several times for a fix, but nothing usable found. Apple have released 10.7.3 and still the problem exists. Note it also exists in the system supplied QuickTime player - so it's not just my code.

So I changed to use the DLS synth interface based on in the Apple PlaySoftMIDI example. The result is exactly the same - really low volume for Midi! I assume that I need to change the properties of the DLS synth, or the DefaultOutput components. My problem is that I cannot find a document that lists the properties applicable to any of the AU unit components.

Answer Source

AudioUnitSetParameter(outSynth, kMusicDeviceParam_Volume, kAudioUnitScope_Global, 0, synthVolume, 0);

Sets the volume in decidels on the DLS synth, and fixed the problem with a setting of 10db.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download