aboutsummaryrefslogtreecommitdiff
path: root/examples/example_4_callHandling
diff options
context:
space:
mode:
Diffstat (limited to 'examples/example_4_callHandling')
-rw-r--r--examples/example_4_callHandling/xmppClient.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/example_4_callHandling/xmppClient.cpp b/examples/example_4_callHandling/xmppClient.cpp
index db3ee820..5a09852d 100644
--- a/examples/example_4_callHandling/xmppClient.cpp
+++ b/examples/example_4_callHandling/xmppClient.cpp
@@ -84,13 +84,18 @@ void xmppClient::slotConnected()
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::SignedInt);
+ // the size in bytes of the audio samples for a single RTP packet
+ const int packetSize = (format.frequency() * format.channels() * (format.sampleSize() / 8)) * channel->payloadType().ptime() / 1000;
+
// initialise audio output
QAudioOutput *audioOutput = new QAudioOutput(format, this);
+ audioOutput->setBufferSize(2 * packetSize);
audioOutput->start(channel);
// initialise audio input
QAudioInput *audioInput = new QAudioInput(format, this);
- audioInput->start(channel);
+ audioInput->setBufferSize(2 * packetSize);
+ audioInput->start(channel);
}
/// A call finished.