scott.rankin Posted September 8, 2015 Share Posted September 8, 2015 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 Quote Link to comment Share on other sites More sharing options...
Administrators hacst Posted September 9, 2015 Administrators Share Posted September 9, 2015 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.