Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
`recorderState`, `isRecording`, `isPaused`, `isStopped`.
recorderState
, isRecording
, isPaused
, isStopped
Dart API: recorderState
Dart API: isRecording
Dart API: isPaused
Dart API: isStopped
This four attributs is used when the app wants to get the current Audio State of the recorder.
recorderState
is an attribut which can have the following values :
isStopped /// Recorder is stopped
isRecording /// Recorder is recording
isPaused /// Recorder is paused
isRecording is a boolean attribut which is true
when the recorder is in the "Recording" mode.
isPaused is a boolean atrribut which is true
when the recorder is in the "Paused" mode.
isStopped is a boolean atrribut which is true
when the recorder is in the "Stopped" mode.
Example:
</div>
constructor
instanciation
Dart API: constructor
You do not need to instanciate the Flutter Sound Helper module. To use this module, you can just use the singleton offers by the module : flutterSoundHelper
.
Example:
</div>
setSubscriptionDuration()
setSubscriptionDuration()
Dart API: setSubscriptionDuration
This verb is used to change the default interval between two post on the "Update Progress" stream. (The default interval is 0 (zero) which means "NO post")
Example:
</div>
setAudioFocus()
setAudioFocus()
Dart API: setAudioFocus
focus:
parameter possible values areAudioFocus.requestFocus (request focus, but do not do anything special with others App)
AudioFocus.requestFocusAndStopOthers (your app will have exclusive use of the output audio)
AudioFocus.requestFocusAndDuckOthers (if another App like Spotify use the output audio, its volume will be lowered)
AudioFocus.requestFocusAndKeepOthers (your App will play sound above others App)
AudioFocus.requestFocusAndInterruptSpokenAudioAndMixWithOthers
AudioFocus.requestFocusTransient (for Android)
AudioFocus.requestFocusTransientExclusive (for Android)
AudioFocus.abandonFocus (Your App will not have anymore the audio focus)
Please look to openAudioSession() to understand the meaning of the other parameters
Example:
</div>
startRecorder()
startRecorder()
You use startRecorder()
to start recording in an open session. startRecorder()
has the destination file path as parameter. It has also 7 optional parameters to specify :
toFile: a path to the file being recorded
sampleRate: The sample rate in Hertz
numChannels: The number of channels (1=monophony, 2=stereophony)
bitRate: The bit rate in Hertz
audioSource : possible value is :
defaultSource
microphone
voiceDownlink (if someone can explain me what it is, I will be grateful ;-) )
Example:
</div>
Dart API:
Dart API:
codec: The codec to be used. Please refer to the to know which codecs are currently supported.
toStream: if you want to record to a Dart Stream. Please look to . This new functionnality needs, at least, Android SDK >= 21 (23 is better)
can be useful if you want to get access to some directories on your device.
Flutter Sound does not take care of the recording permission. It is the App responsability to check or require the Recording permission. is probably useful to do that.
Dart API:
Dart API:
isEncoderSupported()
isEncoderSupported()
Dart API: isEncoderSupported
This verb is useful to know if a particular codec is supported on the current platform; Return a Future.
Example:
</div>
`openAudioSession()` and `closeAudioSession()`
openAudioSession()
and closeAudioSession()
Dart API: openAudioSession
Dart API: closeAudioSession
A recorder must be opened before used. A recorder correspond to an Audio Session. With other words, you must open the Audio Session before using it. When you have finished with a Recorder, you must close it. With other words, you must close your Audio Session. Opening a recorder takes resources inside the OS. Those resources are freed with the verb closeAudioSession()
.
You MUST ensure that the recorder has been closed when your widget is detached from the UI. Overload your widget's dispose()
method to close the recorder when your widget is disposed. In this way you will reset the player and clean up the device resources, but the recorder will be no longer usable.
You maynot openAudioSession many recorders without releasing them. You will be very bad if you try something like :
openAudioSession()
and closeAudioSession()
return Futures. You may not use your Recorder before the end of the initialization. So probably you will await
the result of openAudioSession()
. This result is the Recorder itself, so that you can collapse instanciation and initialization together with myRecorder = await FlutterSoundPlayer().openAudioSession();
The four optional parameters are used if you want to control the Audio Focus. Please look to FlutterSoundPlayer openAudioSession() to understand the meaning of those parameters
Example:
</div>
stopRecorder()
stopRecorder()
Dart API: stopRecorder
Use this verb to stop a record. This verb never throws any exception. It is safe to call it everywhere, for example when the App is not sure of the current Audio State and want to recover a clean reset state.
Example:
</div>