<div dir="ltr"><div><div>Ok I solved it!<br></div>The WAV -file was in 32-bit. Converted it to be 16-bit and it works just fine.<br><br></div>Thank you all for your support.<br></div><div class="gmail_extra"><br clear="all"><div><br>// Peter Pykäläinen</div>
<br><div class="gmail_quote">On 9 October 2014 23:24, Peter Pykäläinen <span dir="ltr"><<a href="mailto:peter.pykalainen@gmail.com" target="_blank">peter.pykalainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<br><br>here is the code:<br><br><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">SoundEffect</span><span style="color:rgb(192,192,192)"> </span>{
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,0)">id</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">shoot</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,0)">source</span>:<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"../sounds/plane_shoot.wav"</span></pre><span style="color:rgb(192,192,192)"></span>}<br><pre style="margin:0px;text-indent:0px"><br></pre><pre style="margin:0px;text-indent:0px"><span style="font-family:arial,helvetica,sans-serif">And sound should be played when a button is pressed.<br></span></pre><pre style="margin:0px;text-indent:0px"><span style="font-family:arial,helvetica,sans-serif">In the onPressed I have:</span> <span style="color:rgb(0,128,0)">shoot.play()<br><br></span></pre><div class="gmail_extra">Actually when I run my app I get:<br><br><span style="font-family:"Courier";font-size:10pt;color:rgb(170,0,0)">QSoundEffect(pulseaudio): Error decoding source</span><br clear="all"></div><div class="gmail_extra"><div><br></div><div>Does this really mean that it can't decode the WAV file or it just can't find it for some reason?<br>Attached is the sound file too.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br>// Peter Pykäläinen</div></font></span><div><div class="h5">
<br><div class="gmail_quote">On 9 October 2014 11:13, Michael Neufing <span dir="ltr"><<a href="mailto:m.neufing@yahoo.de" target="_blank">m.neufing@yahoo.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">That is very strange.<br>
Can you provide an example? It would be nice, if you could link the sound file, too.<br>
<br>
Audio-Element is not supposed to play effect-sounds. It is supposed (as the name states) to play audio (music, streams, etc). According to Qt-Docs, it is quite normal that it has a delay when playing sounds.<br>
<br>
<br>
You could also try to play the sound file on C++-side using QSound (<a href="http://qt-project.org/doc/qt-5/qsound.html" target="_blank">http://qt-project.org/doc/qt-5/qsound.html</a>) - internally QMLs Sound-Element uses QSound, too.<br>
Maybe you'll get more information, why your file can not be processed.<br>
<div><div><br>
<br>
Mit freundlichen Grüßen,<br>
<br>
Michael Neufing<br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>