Skip to content

Commit 5f87730

Browse files
authored
Merge pull request #302 from alnitak/seekBuffer
fix seek on buffer #296
2 parents c990e79 + 88bbfb7 commit 5f87730

File tree

7 files changed

+9
-6
lines changed

7 files changed

+9
-6
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "Flutter debug",
99
"type": "dart",
1010
"request": "launch",
11-
"program": "lib/buffer_stream/web_radio.dart",
11+
"program": "lib/buffer_stream/websocket.dart",
1212
"flutterMode": "debug",
1313
// "env": {
1414
// "NO_OPUS_OGG_LIBS": "1"

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
{
1111
"label": "compile linux debug",
12-
"command": "cd ${workspaceFolder}/example; flutter build linux -t lib/buffer_stream/web_radio.dart --debug",
12+
"command": "cd ${workspaceFolder}/example; flutter build linux -t lib/buffer_stream/websocket.dart --debug",
1313
"type": "shell"
1414
},
1515
{

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#### 3.3.3 (4 Sep 2025)
2+
- fix seek a buffer stream actually seeks at half the wanted position #296
3+
14
#### 3.3.2 (3 Sep 2025)
25
- fixed stuttering with MP3 streams #301
36
- fixed a Web bug when compiling with WASM in release mode.

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ packages:
132132
path: ".."
133133
relative: true
134134
source: path
135-
version: "3.3.0"
135+
version: "3.3.2"
136136
flutter_test:
137137
dependency: "direct dev"
138138
description: flutter

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: >-
33
A low-level audio plugin for Flutter,
44
mainly meant for games and immersive apps.
55
Based on the SoLoud (C++) audio engine.
6-
version: 3.3.2
6+
version: 3.3.3
77
homepage: https://github.com/alnitak/flutter_soloud
88
maintainer: Marco Bavagnoli (@lildeimos)
99
platforms:

src/audiobuffer/audiobuffer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ namespace SoLoud
152152
}
153153
offset = aSeconds;
154154
}
155-
long samples_to_discard = (long)floor(mBaseSamplerate * offset);
155+
long samples_to_discard = (long)floor(mBaseSamplerate * offset * mChannels);
156156

157157
while (samples_to_discard)
158158
{
@@ -162,7 +162,7 @@ namespace SoLoud
162162
getAudio(mScratch, samples, samples);
163163
samples_to_discard -= samples;
164164
}
165-
int pos = (int)floor(mBaseSamplerate * aSeconds);
165+
int pos = (int)floor(mBaseSamplerate * mChannels * aSeconds);
166166
mOffset = pos;
167167
mStreamPosition = float(pos / mBaseSamplerate);
168168
return SO_NO_ERROR;

web/libflutter_soloud_plugin.wasm

23 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)