This is a read-only archive of the Mumble forums.

This website archives and makes accessible historical state. It receives no updates or corrections. It is provided only to keep the information accessible as-is, under their old address.

For up-to-date information please refer to the Mumble website and its linked documentation and other resources. For support please refer to one of our other community/support channels.

Jump to content

Question about AudioOutput::qmOutputs as QMultiHash


scott.rankin
 Share

Recommended Posts

Hello,

Please forgive my novice question. I'm not super versed with Qt.


I was looking at the use of AudioOutput::qmOutputs specifically with respect to it's use in AudioOutputSpeech.cpp and wondered why it was a QMultiHash?


It seems to me that in AudioOutput::addFrameToBuffer that it just fishes out the first one the map finds with this call?

AudioOutputSpeech *aop = qobject_cast(qmOutputs.value(user));


Cheers,

Scott

Link to comment
Share on other sites

  • Administrators

Hi. AudioOutputSample instances do not have a user assigned to them and hence are all added with "NULL" into the output list:

AudioOutputSample *AudioOutput::playSample(const QString &filename, bool loop) {
...
AudioOutputSample *aos = new AudioOutputSample(filename, handle, loop, iMixerFreq);
qmOutputs.insert(NULL, aos);
...
}

(see line 227ff. in AudioOutput.cpp). This means to allow playback of multiple sample files at the same time qmOutputs needs to be a multi hash. addFrameToBuffer isn't used there as the samples do not come from the network into the buffer but come directly from a sound file.

Link to comment
Share on other sites

 Share

×
×
  • Create New...