PDA

View Full Version : playing sound from resource file



user4592357
10th March 2018, 18:16
i suppose there is a way to define a sound resource in .qrc and have it played.

but how?


QSound::play(":/sounds/abracadabra") doesn't work.

it's defined like this in .qrc


<qresource prefix="/sounds">
<file alias="abracadabra">sounds/abracadabra.wav</file>
</qresource>

d_stranz
11th March 2018, 16:22
Try using the resource path ":/sounds/sounds/abracadabra.wav". Resource paths can be tricky.