Returns the minimum buffer size required for the successful creation of an AudioTrack object to be created in the MODE_STREAM mode. Note that this size doesn't guarantee a smooth playback under load, and higher values should be chosen according to the expected frequency at which the buffer will be refilled with additional data to play.
returns :
-2 if an invalid parameter was passed -1 if the implementation was unable to query the hardware for its output properties, or the minimum buffer size expressed in bytes.
GetMinVolumeAsFloat
Returns the minimum valid volume value. Volume values set under this one will be clamped at this value.
GetNativeOutputSampleRate (streamTypeAsInt) AsInt
Returns the hardware output sample rate
GetNotificationMarkerPositionAsInt
Returns marker position expressed in frames.
GetPlaybackHeadPositionAsInt
Returns the playback head position expressed in frames
GetPlaybackRateAsInt
Returns the current playback rate in Hz.
GetPlayStateAsInt
Returns the playback state of the AudioTrack instance.
Returns the notification update period expressed in frames.
GetSampleRateAsInt
Returns the configured audio data sample rate in Hz
GetStateAsInt
Returns the state of the AudioTrack instance. This is useful after the AudioTrack instance has been created to check if it was initialized properly. This ensures that the appropriate hardware resources have been acquired.
GetStreamTypeAsInt
Returns the type of audio stream this AudioTrack is configured for. Compare the result against STREAM_VOICE_CALL, STREAM_SYSTEM, STREAM_RING, STREAM_MUSIC or STREAM_ALARM
StreamType - the type of the audio stream. See STREAM_VOICE_CALL, STREAM_SYSTEM, STREAM_RING, STREAM_MUSIC and STREAM_ALARM SampleRate - 44100 is standard and should work on all devices,22050,16000.11025 and 8000 may work on some Channel config - Mono or Stereo depending on available hardware, Mono is the safe option Audio format, 8 or 16 bit encoding Buffer size - the total size (in bytes) of the buffer where audio data is written to during the recording. Mode - streaming or static buffer. See MODE_STATIC and MODE_STREAM See getMinBufferSize(int, int, int) to determine the minimum required buffer size for the successful creation of an AudioTrack instance. Using values smaller than getMinBufferSize() will result in an initialization failure. To use Marker callback you need to create a sub called Audiotrack_MarkerReached in your Main Module and SetNotificationMarkerPosition To use Periodic callback you need to create a sub called Audiotrack_PeriodPassed in your Main Module and and SetPositionNotificationPeriod
StreamType - the type of the audio stream. See STREAM_VOICE_CALL, STREAM_SYSTEM, STREAM_RING, STREAM_MUSIC and STREAM_ALARM SampleRate - 44100 is standard and should work on all devices,22050,16000.11025 and 8000 may work on some Channel config - Mono or Stereo depending on available hardware, Mono is the safe option Audio format, 8 or 16 bit encoding Buffer size - the total size (in bytes) of the buffer where audio data is written to during the recording. Mode - streaming or static buffer. See MODE_STATIC and MODE_STREAM sessionID - Id of audio session the AudioTrack must be attached to See getMinBufferSize(int, int, int) to determine the minimum required buffer size for the successful creation of an AudioTrack instance. Using values smaller than getMinBufferSize() will result in an initialization failure. To use Marker callback you need to create a sub called Audiotrack_MarkerReached in your Main Module and SetNotificationMarkerPosition To use Periodic callback you need to create a sub called Audiotrack_PeriodPassed in your Main Module and and SetPositionNotificationPeriod
IsInitializedAsBoolean
Mode_StaticAsInt
Mode_StreamAsInt
Pause
Pauses the playback of the audio data. Data that has not been played back will not be discarded. Subsequent calls to play() will play this data back.
Play
Starts playing an AudioTrack.
Playstate_PausedAsInt
Playstate_PlayingAsInt
Playstate_StoppedAsInt
Release
Releases the native AudioTrack resources.
ReloadStaticDataAsInt
Notifies the native resource to reuse the audio data already loaded in the native layer. This call is only valid with AudioTrack instances that don't use the streaming model.
SetAuxEffectSendLevel (levelAsFloat) AsInt
Sets the send level of the audio track to the attached auxiliary effect attachAuxEffect(int). The level value range is 0 to 1.0. By default the send level is 0, so even if an effect is attached to the player this method must be called for the effect to be applied.
Sets the loop points and the loop count. The loop can be infinite. startInFrames - loop start marker expressed in frames endInFrames - loop end marker expressed in frames loopCount - the number of times the loop is looped. A value of -1 means infinite looping.
Sets the specified left/right output volume values on the AudioTrack. Values are clamped to the (getMinVolume(), getMaxVolume()) interval if outside this range.
Writes the audio data to the audio hardware for playback. Will block until all data has been written to the audio mixer. Note that the actual playback of this data might occur after this function returns. This function is thread safe with respect to stop() calls, in which case all of the specified data might not be written to the mixer.
Writes the audio data to the audio hardware for playback. Will block until all data has been written to the audio mixer. Note that the actual playback of this data might occur after this function returns. This function is thread safe with respect to stop() calls, in which case all of the specified data might not be written to the mixer.
Top