We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 86e02c5 + 1b76652 commit f1aaf35Copy full SHA for f1aaf35
src/SDWaveFile.cpp
@@ -141,10 +141,10 @@ long SDWaveFile::currentTime()
141
int SDWaveFile::cue(long time)
142
{
143
if (time < 0) {
144
- return 1;
+ return 0;
145
}
146
147
- long offset = (time * _blockAlign) - _dataOffset;
+ long offset = (time * _blockAlign * _sampleRate) + _dataOffset;
148
149
if (offset < 0) {
150
offset = 0;
@@ -154,12 +154,12 @@ int SDWaveFile::cue(long time)
154
offset = (offset / 512) * 512;
155
156
if ((uint32_t)offset > _file.size()) {
157
158
159
160
_file.seek(offset);
161
-
162
- return 0;
+
+ return 1;
163
164
165
int SDWaveFile::begin()
0 commit comments