flutter_soloud 2.1.6 flutter_soloud: ^2.1.6 copied to clipboard
A low-level audio plugin for Flutter, mainly meant for games and immersive apps. Based on the SoLoud (C++) audio engine.
2.1.6 (17 Oct 2024) #
- fixed a bug that caused an error when loading a sound more than twice.
2.1.5 (11 Oct 2024) #
- added
readSamplesFrom*()
methods to read N audio data within a time range from a file or memory #75. Example inexample/lib/wave_data/wave_data.dart
.
2.1.4 (18 Sep 2024) #
- fixed waveform generation which somehow oscillate frequencies after some time #129.
- fixed iOS compilation by rising minimum iOS version to 13 #128.
- fixed iOS compilation on the new MacOS 15 with XCode 16 #130.
2.1.3 (7 Sep 2024) #
- added audio_data example.
- added compatibility for Web platform in the pubspec.
- bug fix when loading multiple audio files asynchronously.
- better error message when something goes wrong loading a file.
2.1.2 (29 Aug 2024) #
- bug fix when loading multiple audio files asynchronously.
2.1.1 (28 Aug 2024) #
- added
bool isActive
andint index
getters to filters. - added a
timeStretch()
method to single pitchshift filter. - fixed building error on Windows.
- updated examples.
2.1.0 (23 Aug 2024) #
- added support for the Web platform.
- added
getPan()
,setPan()
andsetPanAbsolute()
. - added
loadMem()
to read the give audio file bytes buffer (not RAW data). Useful for the Web platform. - fixed
getFilterParamNames()
. - added
AudioData
class to manage audio samples. - added player initialization parameters: sample rate, buffer size, number of channels (mono, stereo, quad, 5.1, 7.1).
- added voice groups.
- it's now possible to set filters not only globally, but also to single audio sources (not on the web platform).
- fade and oscillate filter parameters.
- experimental capture feature removed.
- now accessing to filter has been simplified with the use of
SoLoud.filters
andAudioSource.filters
to use global and single sound filters.
2.0.2 (23 May 2024) #
- Fixed wrong exception raised by
setVolume()
when a handle is no more valid.
2.0.1 (6 May 2024) #
- Fix init error on hot restart.
2.0.0 (5 Apr 2024) #
-
A giant leap forward from the previous version (many thanks to Filip Hráček).
-
Major changes to API. There are quick fixes (
dart fix
) to automatically rename many changed APIs. -
SoLoud
methods now throw instead of returning a PlayerErrors object. -
added
getActiveVoiceCount()
to get concurrent sounds that are playing at the moment. -
added
countAudioSource()
to get concurrent sounds that are playing a specific audio source. -
added
getVoiceCount()
to get the number of voices the application has told SoLoud to play. -
added
getMaxActiveVoiceCount()
to get the current maximum active voice count. -
added
setMaxActiveVoiceCount()
to set the current maximum active voice count. -
added
setProtectVoice()
andgetProtectVoice()
to get/set the protect voice flag. -
SoLoud.activeSounds
is now anIterable
instead of aList
. -
All time-related parameters and return values are now
Duration
type. Before, they weredouble
. -
Added new (experimental)
AudioSource.allInstancesFinished
stream. This can be used to more easily await times when it's safe to dispose the sound. For example:final source = soloud.loadAsset('...'); // Wait for the first time all the instances of the sound are finished // (finished playing or were stopped with soloud.stop()). source.allInstancesFinished.first.then( // Dispose of the sound. (_) => soloud.disposeSound(source) ); soloud.play(source);
-
added
looping
andloopingStartAt
properties toSoLoud.play()
andSoLoud.play3d()
. -
added
SoLoud.getLooping()
to retrieve the looping state of a sound. -
added
SoLoud.getLoopPoint()
andSoLoud.setLoopPoint()
to get and set the looping start position of a sound. -
New methods
SoLoud.loadAsset()
andSoLoud.loadUrl()
to load audio from assets and URLs, respectively. -
added
mode
property toSoLoud.loadFile()
andSoloudTools.loadFrom*
to prevent to load the whole audio data into memory:- LoadMode.memory by default. Means less CPU, more memory allocated.
- LoadMode.disk means more CPU, less memory allocated. Lags can occurs while seeking MP3s, especially when using a slider.
-
Switched from
print()
logging to using the standardpackage:logging
. SeeREADME.md
to learn how to capture log messages and how to filter them. -
The capture feature is on experimental stage to be fine tuned in the near future. All methods related to audio capture have been extracted to a separate class. So now, there are two classes:
SoLoud
for playing audioSoLoudCapture
for capturing audio
-
The Web platform is a work in progress, stay tuned!
-
Switched LICENSE from Apache-2.0 to MIT.
2.0.0-pre.5 (4 Apr 2024) #
- getLoopPoint now returns Duration.
- Major changes to API docs and README.
- Renamed
SoLoud.disposeSound
toSoLoud.disposeSource
. Quick fix available. - Renamed
SoLoud.disposeAllSound
toSoLoud.disposeAllSources
. Quick fix available. - Removed unused
AudioSource.keys
property. - Switched LICENSE from Apache-2.0 to MIT.
2.0.0-pre.4 (21 Mar 2024) #
- some little fixes.
2.0.0-pre.3 (20 Mar 2024) #
-
added
getActiveVoiceCount()
to get concurrent sounds that are playing at the moment. -
added
countAudioSource()
to get concurrent sounds that are playing a specific audio source. -
added
getVoiceCount()
to get the number of voices the application has told SoLoud to play. -
added
getMaxActiveVoiceCount()
to get the current maximum active voice count. -
added
setMaxActiveVoiceCount()
to set the current maximum active voice count. -
added
setProtectVoice()
andgetProtectVoice()
to get/set the protect voice flag. -
All time-related parameters and return values are now
Duration
type. Before, they weredouble
. -
Fixed velocity computation bug in
example/
. -
Renamed
SoundEvent
toSoundEventType
. Quick fix available. -
SoundProps.soundEvents
is now aStream
, not aStreamController
-
SoundProps.soundEvents
stream is now closed automatically whenSoLoud.disposeSound()
is called. -
SoLoud.activeSounds
is now anIterable
instead of aList
(therefore, it cannot be modified from outside the package). -
Renamed
SoLoud.getFxParams
toSoLoud.getFilterParameter
. This mimics the C++ API name. Quick fix available. -
Renamed
SoLoud.setFxParams
toSoLoud.setFilterParameter
. This mimics the C++ API name. Quick fix available. -
Renamed
SoundProps
toAudioSource
. Quick fix available. -
Added new (experimental)
AudioSource.allInstancesFinished
stream. This can be used to more easily await times when it's safe to dispose the sound. For example:final source = soloud.loadAsset('...'); // Wait for the first time all the instances of the sound are finished // (finished playing or were stopped with soloud.stop()). source.allInstancesFinished.first.then( // Dispose of the sound. (_) => soloud.disposeSound(source) ); soloud.play(source);
-
Deprecated
shutdown()
. Replaced with the synchronousdeinit()
. Quick fix available. -
Renamed
initialize()
toinit()
, in order to come closer to the original C++ API, and also to have a symmetry (init
/deinit
). Quick fix available.
2.0.0-pre.2 (14 Mar 2024) #
NOTE: This version is much more breaking than the ones before it.
It might be worth it to first upgrade your code to 2.0.0-pre.1
,
use the quick fixes to rename the methods, and only then upgrade
to 2.0.0-pre.2
and beyond.
-
SoLoud
methods now throw instead of returning aPlayerErrors
object. This is a massive breaking change, but it makes the package API more idiomatic and easier to use.Before:
final ret = await SoLoud.play(sound); if (ret.error != PlayerErrors.noError) { print('Oh no! ${ret.error}'); } else { print('Playing sound with new handle: ${ret.newHandle}'); }
After:
try { final handle = await SoLoud.play(sound); print('Playing sound with new handle: $handle'); } on SoLoudException catch (e) { print('Oh no! $e'); }
2.0.0-pre.1 (12 Mar 2024) #
- added
looping
andloopingStartAt
properties toSoLoud.play()
andSoLoud.play3d()
. - added
SoLoud.getLooping()
to retrieve the looping state of a sound. - added
SoLoud.getLoopPoint()
andSoLoud.setLoopPoint()
to get and set the looping start position of a sound. - New methods
SoLoud.loadAsset()
andSoLoud.loadUrl()
to load audio from assets and URLs, respectively. These replace the oldSoloudTools.loadFrom*
methods (which are now deprecated).- The new methods also correctly invalidate the temporary files (for example, when an asset changes between versions of the app, we don't want to play the old file).
- Rename
SoloudTools
toSoLoudTools
for consistency. (Quick fix available.) - Rename
SoLoudTools.initSounds
toSoLoudTools.createNotes
for clarity. (Quick fix available.)
2.0.0-pre.0 (11 Mar 2024) #
- added
bool SoLoud.getVisualizationEnabled()
to get the current state of the visualization. - added
mode
property toSoLoud.loadFile()
andSoloudTools.loadFrom*
to prevent to load the whole audio data into memory:- LoadMode.memory by default. Means less CPU, more memory allocated.
- LoadMode.disk means more CPU, less memory allocated. Lags can occurs while seeking MP3s, especially when using a slider.
- Switched from
print()
logging to using the standardpackage:logging
. SeeREADME.md
to learn how to capture log messages and how to filter them. - Renamed
SoLoud.startIsolate()
toSoLoud.initialize()
- Renamed
SoLoud.stopIsolate()
toSoLoud.shutdown()
- Removed
SoLoud.initEngine()
(it shouldn't be called manually) - None of the renaming changes are strictly breaking (yet).
The old method names still exist as aliases to the new names, and are
merely marked
@deprecated
. There is a quick fix (dart fix
) to automatically rename them. - The singleton SoLoud instance is now accessible through
SoLoud.instance
. Accessing it throughSoLoud()
is now deprecated.- This change cannot be automated through a Quick Fix.
You will need to manually replace
SoLoud()
withSoLoud.instance
in your code.
- This change cannot be automated through a Quick Fix.
You will need to manually replace
- All methods related to audio capture have been extracted to a separate class.
So now, there are two classes:
SoLoud
for playing audioSoLoudCapture
for capturing audio
- The
SoLoud
class is now aninterface
class. This means you can implement it (e.g. for mocking in tests) but you can't extend it. This reduces the fragile base class problem and makes the API easier to evolve. - Added a new, more usable way of finding out whether the audio engine
is initialized and ready to use:
SoLoud.initialized
(returns a future, safe to check during initialization)- This is a much easier way to check engine readiness than
subscribing to
SoLoud.audioEvents
and waiting for theisolateStarted
event.
- This is a much easier way to check engine readiness than
subscribing to
SoLoud.isInitialized
(returns synchronously)- previous methods to check readiness (
isPlayerInited
andisIsolateRunning()
) are now deprecated
SoLoud.initialize()
can now be safely called during engine shutdown. It will wait for the engine to shut down before re-initializing it. Same forSoLoud.shutdown()
, which will wait for the engine to initialize before shutting it down, to avoid various race conditions.- Sound handles and sound hashes are now typed:
SoundHandle
andSoundHash
instead of raw integers. This prevents from erroneously passing a sound handle as a sound hash, for example. This is a breaking API change but, in practice, shouldn't be much of a problem, since these objects were always meant as identifiers (to be taken from some API calls and put into others). SoundProps.handle
renamed toSoundProps.handles
(because it's a Set) and also disallowed modifying it from outside the package.- All fields of
SoundProps
markedfinal
. This is a breaking change but unlikely to have effect (as most users hopefully don't assign to these fields).
1.2.5 (2 Mar 2024) #
- updated mp3, flac and wav decoders
- updated miniaudio to 0.11.21
- fixed doppler effect in 3D audio example
1.2.4 #
fixed compilation on Windows
1.2.3 #
- fixed compilation on iOS and macOS
1.2.2 #
- waveform example page updated with sound FXs
- added sound FXs
- biquadResonantFilter
- eqFilter
- echoFilter
- lofiFilter
- flangerFilter
- bassboostFilter
- waveShaperFilter
- robotizeFilter
- freeverbFilter
1.2.1 #
- binded some more SoLoud functionalities:
- fadeGlobalVolume
- fadeVolume
- fadePan
- fadeRelativePlaySpeed
- schedulePause
- scheduleStop
- oscillateVolume
- oscillatePan
- oscillateRelativePlaySpeed
- oscillateGlobalVolume
- waveform example page updated
1.2.0 #
- added waveform generator
- added a test page for waveform
- added some tests in
tests
dir - miniaudio updated to v0.11.18
1.1.1 #
- SoLoud().loadFile now can return PlayerErrors.fileAlreadyLoaded when a sound has already been loaded previously. It still return the SoundProps sound. It's not a breaking error.
- added Soloud().disposeAllSound to stop and dispose all active sounds
breaking change: Soloud().stopSound has been renamed to Soloud().disposeSound
1.1.0 #
added load sound tools:
- SoloudLoadingTool.loadFromAssets()
- SoloudLoadingTool.loadFromFile()
- SoloudLoadingTool.loadFromUrl()
added also a spin around example
1.0.0 #
- added 3D audio with example
0.9.0 #
- added capture from microphone with example
0.1.0 #
Initial release:
- Supported on Linux, Windows, Mac, Android, and iOS
- Multiple voices, capable of playing different sounds simultaneously or even repeating the same sound multiple times on top of each other
- Includes a speech synthesizer
- Supports various common formats such as 8, 16, and 32-bit WAVs, floating point WAVs, OGG, MP3, and FLAC
- Enables real-time retrieval of audio FFT and wave data