diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
index 5dbc1a0c99311a917f0f59e744dcb4eff4324797..bf647ea1fd8c5e4e8d37b5babb161c947a79759a 100644
--- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp
+++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
@@ -73,20 +73,23 @@ inline pa_sample_spec audioFormatToSampleSpec(const QAudioFormat &format)
 
     spec.rate = format.sampleRate();
     spec.channels = format.channelCount();
-
-    if (format.sampleSize() == 8)
-        spec.format = PA_SAMPLE_U8;
-    else if (format.sampleSize() == 16) {
-        switch (format.byteOrder()) {
-            case QAudioFormat::BigEndian: spec.format = PA_SAMPLE_S16BE; break;
-            case QAudioFormat::LittleEndian: spec.format = PA_SAMPLE_S16LE; break;
-        }
-    }
-    else if (format.sampleSize() == 32) {
-        switch (format.byteOrder()) {
-            case QAudioFormat::BigEndian: spec.format = PA_SAMPLE_S32BE; break;
-            case QAudioFormat::LittleEndian: spec.format = PA_SAMPLE_S32LE; break;
+    spec.format = PA_SAMPLE_INVALID;
+    const bool isBigEndian = (format.byteOrder() == QAudioFormat::BigEndian);
+
+    if (format.sampleType() == QAudioFormat::UnSignedInt) {
+        if (format.sampleSize() == 8)
+            spec.format = PA_SAMPLE_U8;
+    } else if (format.sampleType() == QAudioFormat::SignedInt) {
+        if (format.sampleSize() == 16) {
+            spec.format = isBigEndian ? PA_SAMPLE_S16BE : PA_SAMPLE_S16LE;
+        } else if (format.sampleSize() == 24) {
+            spec.format = isBigEndian ? PA_SAMPLE_S24BE : PA_SAMPLE_S24LE;
+        } else if (format.sampleSize() == 32) {
+            spec.format = isBigEndian ? PA_SAMPLE_S32BE : PA_SAMPLE_S32LE;
         }
+    } else if (format.sampleType() == QAudioFormat::Float) {
+        if (format.sampleSize() == 32)
+            spec.format = isBigEndian ? PA_SAMPLE_FLOAT32BE : PA_SAMPLE_FLOAT32LE;
     }
 
     return spec;