The τ API.
τ is composed with 4 modules :
FlutterSoundPlayer
, wich deal with everything about playbacks
FlutterSoundRecorder
, which deal with everything about recording
FlutterSoundHelper
, which offers some convenients tools
FlutterSoundUI
, which offer some Widget ready to be used out of the box
To use Flutter Sound you just do :
This will import all the necessaries dart interfaces.
Instance one ore more players. A good place to do that is in your init()
function. It is also possible to instanciate the players "on the fly", when needed.
Open it. You cannot do anything on a close Player. An audio-session is then created.
Use the various verbs implemented by the players.
startPlayer()
startPlayerFromStream()
startPlayerFromBuffer()
setVolume()
FlutterSoundPlayer.stopPlayer()
...
Close your players.
This is important to close every player open for freeing the resources taken by the audio session.
A good place to do that is in the dispose()
procedure.
Instance your recorder. A good place to do that is in your init()
function.
Open it. You cannot do anything on a close Recorder. An audio-session is then created.
Use the various verbs implemented by the players.
startRecorder()
pauseRecorder()
resumeRecorder()
stopRecorder()
...
Close your recorder.
This is important to close it for freeing the resources taken by the audio session.
A good place to do that is in the dispose()
procedure.