audioplayers library

Classes

AssetSource
Source representing the path of an application asset in your Flutter "assets" folder. Note that a prefix might be applied by your AudioPlayer's audio cache instance.
AudioCache
This class represents a cache for Local Assets to be played.
AudioContext
An Audio Context is a set of secondary, platform-specific aspects of audio playback, typically related to how the act of playing audio interacts with other features of the device. AudioContext is containing platform specific configurations: AudioContextAndroid and AudioContextIOS.
AudioContextAndroid
A platform-specific class to encapsulate a collection of attributes about an Android audio stream.
AudioContextConfig
This class contains flags to control several secondary, platform-specific aspects of audio playback, like how this audio interact with other audios, how is it played by the device and what happens when the app is backgrounded. However, note that each platform has its nuances on how to configure audio. This class is a generic abstraction of some parameters that can be useful across the board. Its flags are simple abstractions that are then translated to an AudioContext containing platform specific configurations: AudioContextAndroid and AudioContextIOS. If these simplified flags cannot fully reflect your goals, you must create an AudioContext configuring each platform separately.
AudioContextIOS
A platform-specific class to encapsulate a collection of attributes about an iOS audio stream.
AudioEvent
Event emitted from the platform implementation.
AudioLogger
AudioPlayer
This represents a single AudioPlayer, which can play one audio at a time. To play several audios at the same time, you must create several instances of this class.
AudioPool
An AudioPool is a provider of AudioPlayers that are pre-loaded with an asset to minimize delays.
BytesSource
Source containing the actual bytes of the media to be played.
DeviceFileSource
Source representing the absolute path of a file in the user's device.
FramePositionUpdater
GlobalAudioEvent
Event emitted from the platform implementation.
GlobalAudioScope
Handle global audio scope like calls and events concerning all AudioPlayers.
PositionUpdater
Source
A generic representation of a source from where audio can be pulled.
TimerPositionUpdater
UrlSource
Source representing a remote URL to be played from the Internet. This can be an audio file to be downloaded or an audio stream.

Enums

AndroidAudioFocus
There are four focus request types. A successful focus request with each will yield different behaviors by the system and the other application that previously held audio focus. See https://developer.android.com/reference/android/media/AudioFocusRequest
AndroidAudioMode
The audio mode encompasses audio routing AND the behavior of the telephony layer. Therefore this flag should only be used by applications that replace the platform-wide management of audio settings or the main telephony application. In particular, the inCall mode should only be used by the telephony application when it places a phone call, as it will cause signals from the radio layer to feed the platform mixer.
AndroidContentType
"what" you are playing. The content type expresses the general category of the content. This information is optional. But in case it is known (for instance movie for a movie streaming service or music for a music playback application) this information might be used by the audio framework to selectively configure some audio post-processing blocks.
AndroidUsageType
"why" you are playing a sound, what is this sound used for. This is achieved with the "usage" information. Examples of usage are media and alarm. These two examples are the closest to stream types, but more detailed use cases are available. Usage information is more expressive than a stream type, and allows certain platforms or routing policies to use this information for more refined volume or routing decisions. Usage is the most important information to supply in AudioContextAndroid and it is recommended to build any instance with this information supplied.
AudioContextConfigFocus
AudioContextConfigRoute
AudioEventType
AudioLogLevel
AVAudioSessionCategory
This is a Dart representation of the equivalent enum on Swift.
AVAudioSessionOptions
This is a Dart representation of the equivalent enum on Swift.
GlobalAudioEventType
PlayerMode
This represents what kind of native implementation is used by the player.
PlayerState
Indicates the state of the audio player.
ReleaseMode
This enum is meant to be used as a parameter of setReleaseMode method.

Typedefs

StopFunction = Future<void> Function()
Represents a function that can stop an audio playing.

Exceptions / Errors

AudioPlayerException