We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f21681 commit d2e3104Copy full SHA for d2e3104
src/audio/audioplayer.cpp
@@ -67,7 +67,17 @@ void AudioPlayer::start()
67
if (!AudioEngine::initialized())
68
return;
69
70
- ma_result result = ma_sound_start(m_sound);
+ if (isPlaying())
71
+ stop();
72
+
73
+ ma_result result = ma_sound_seek_to_pcm_frame(m_sound, 0);
74
75
+ if (result != MA_SUCCESS) {
76
+ std::cerr << "Failed to seek to PCM frame 0." << std::endl;
77
+ m_started = false;
78
+ }
79
80
+ result = ma_sound_start(m_sound);
81
82
if (result != MA_SUCCESS) {
83
std::cerr << "Failed to start sound." << std::endl;
0 commit comments