QMediaPlayer *player = new QMediaPlayer; player->setMedia(QUrl::fromLocalFile("ballhit.wav")); player->setVolume(50); player->play();