Main topic
title: "τ API"
description: "The τ API."
summary: "τ is composed with 4 modules."
permalink: tau_api_main.html
tags: api,getting_started
keywords: API
The Main modules
τ is composed with 4 modules :
FlutterSoundPlayer
, wich deal with everything about playbacksFlutterSoundRecorder
, which deal with everything about recordingFlutterSoundHelper
, which offers some convenients toolsFlutterSoundUI
, which offer some Widget ready to be used out of the box
To use Flutter Sound you just do :
import 'package:flutter_sound/flutter_sound.dart';
This will import all the necessaries dart interfaces.
Playback
- 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.
FlutterSoundPlayer myPlayer = FlutterSoundPlayer();
- Open it. You cannot do anything on a close Player. An audio-session is then created.
myPlayer.openAudioSession().then( (){ ...} );
- 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.
myPlayer.closeAudioSession();
Recording
- Instance your recorder.
A good place to do that is in your
init()
function.
FlutterSoundRecorder myRecorder = FlutterSoundRecorder();
- Open it. You cannot do anything on a close Recorder. An audio-session is then created.
myRecorder.openAudioSession().then( (){ ...} );
- 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.
myRecorder.closeAudioSession();
Libraries
- public/flutter_sound_player Main
- THE Flutter Sound Player
- public/flutter_sound_recorder Main
- THE Flutter Sound Recorder
- public/tau Main