Skip to content

Commit

Permalink
Merge pull request #176 from alnitak/bufferingType
Browse files Browse the repository at this point in the history
feat: Buffering preserved and released types
  • Loading branch information
alnitak authored Feb 13, 2025
2 parents 9f4a18f + f4605be commit a0c0ed2
Show file tree
Hide file tree
Showing 179 changed files with 21,317 additions and 2,426 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "Flutter debug",
"type": "dart",
"request": "launch",
"program": "lib/audio_data/audio_data.dart",
"program": "lib/buffer_stream/websocket.dart",
"flutterMode": "debug",
"cwd": "${workspaceFolder}/example"
},
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"label": "compile linux debug",
"command": "cd ${workspaceFolder}/example; flutter build linux -t lib/test.dart --debug",
"command": "cd ${workspaceFolder}/example; flutter build linux -t lib/buffer_stream/websocket.dart --debug",
"type": "shell"
},
{
Expand Down
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@

### 3.0.0-pre.2 ()
### 3.0.0 (13 Feb 2025)
- `BufferStream` now supports 2 type of buffering:
- `BufferingType.preserved` (default): preserve the data already in the buffer while playing.
- `BufferingType.released`: free the memory of the already played data for longer playback.
- breaking change: splitted [maxBufferSize] to [maxBufferSizeBytes] and [maxBufferSizeDuration] in `SoLoud.setBufferStream`. This gives the user a way to choose the maximum buffer size using bytes or time.
- breaking change: removed `initialized` getter in favor of `isInitialized`
- removed deprecated `timeout` parameter in `SoLoud.init`.
- removed deprecated `filter_params.dart`.
- fixed biquad resonant filter `frequency` default parameter #179
- fix: on some unclear conditions `isInitialized` returning false on MacOS after engine starts with no error #177

### 3.0.0-pre.1 (3 Feb 2025)
- fix: Call `loadMem` will crash the application #174.

### 3.0.0-pre.0 (2 Feb 2025)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ On Linux and MacOS theese libraries must be installed if you want to use this ki

if the libraries are not found the plugin will throw an exception when calling `setBufferStream` using Opus format.

The `SoLoud.setBufferStream` supports also `BufferingType.preserved` which behaves the same as a normal `AudioSource`, and `BufferingType.released` which will free the memory of the already played audio for longer playback. The latter will accept to play only one instance of the audio stream at the same time.
|BufferingType.preserved|BufferingType.released|
|------------------------------------|----------------------------------|
|![preserved](/~https://github.com/user-attachments/assets/e8699bfd-2a40-4832-a7a8-d729d844c48b)|![released](/~https://github.com/user-attachments/assets/7eb57688-ab0f-4859-813f-d23fff6ca10f)|
|acts as normal leaving the whole audio data available for future re-play|while playing the already listened audio is freed. It can be listened to only once and the sound must be manually disposed|

#### Web platform
To use this plugin on the **Web platform**, please add the following scripts to the `<head>` or `<body>` section of your `index.html`:
```
Expand Down
Empty file.
Loading

0 comments on commit a0c0ed2

Please sign in to comment.