Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
Android Documentation
AudioStreamManager

Class AudioStreamManager

Hierarchy

java.lang.Object
     com.smartdevicelink.managers.BaseSubManager
         com.smartdevicelink.managers.audio.BaseAudioStreamManager

Package
com.smartdevicelink.managers.audio

Overview

The AudioStreamManager class provides methods to start and stop an audio stream to the connected device. Audio files can be pushed to the manager in order to play them on the connected device. The manager uses the Android built-in MediaCodec.

Fields

Inherited Fields

From Class Fields
com.smartdevicelink.managers.BaseSubManager SETTING_UP, READY, LIMITED, SHUTDOWN, ERROR, internalInterface

Constructors

AudioStreamManager( ISdl internalInterface, Context context )

Creates a new object of AudioStreamManager

public AudioStreamManager(ISdl internalInterface,Context context)

Constructor Parameters

internalInterface
The internal interface to the connected device.
context

Methods

start( CompletionListener listener )

public void start(CompletionListener listener)

Method Parameters

listener

dispose()

public void dispose()

startAudioStream( boolean encrypted, CompletionListener completionListener )

Starts the audio service and audio stream to the connected device. The method is non-blocking.

public void startAudioStream(boolean encrypted,CompletionListener completionListener)

Method Parameters

encrypted
Specify whether or not the audio stream should be encrypted.
completionListener

stopAudioStream( CompletionListener completionListener )

Stops the audio service and audio stream to the connected device. The method is non-blocking.

public void stopAudioStream(CompletionListener completionListener)

Method Parameters

completionListener

pushResource( int resourceId, CompletionListener completionListener )

Pushes the specified resource file to the playback queue. The audio file will be played immediately. If another audio file is currently playing the specified file will stay queued and automatically played when ready.

public void pushResource(int resourceId,CompletionListener completionListener)

Method Parameters

resourceId
The specified resource file to be played.
completionListener
A completion listener that informs when the audio file is played.

pushAudioSource( Uri audioSource, CompletionListener completionListener )

Pushes the specified audio file to the playback queue. The audio file will be played immediately. If another audio file is currently playing the specified file will stay queued and automatically played when ready.

public void pushAudioSource(Uri audioSource,CompletionListener completionListener)

Method Parameters

audioSource
The specified audio file to be played.
completionListener
A completion listener that informs when the audio file is played.

pushBuffer( ByteBuffer data, CompletionListener completionListener )

Pushes raw audio data to SDL Core. The audio file will be played immediately. If another audio file is currently playing, the specified file will stay queued and automatically played when ready.

public void pushBuffer(ByteBuffer data,CompletionListener completionListener)

Method Parameters

data
Audio raw data to send.
completionListener
A completion listener that informs when the audio file is played.

onTransportUpdate( java.util.List<com.smartdevicelink.transport.utl.TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail )

protected void onTransportUpdate(java.util.List<com.smartdevicelink.transport.utl.TransportRecord> connectedTransports,boolean audioStreamTransportAvail,boolean videoStreamTransportAvail)

Method Parameters

connectedTransports
audioStreamTransportAvail
videoStreamTransportAvail

startAudioStream( SdlSession session )

protected com.smartdevicelink.streaming.audio.IAudioStreamListener startAudioStream(SdlSession session)

Method Parameters

session

stopAudioStream()

protected boolean stopAudioStream()

Inherited Methods

From Class Methods
com.smartdevicelink.managers.BaseSubManager start, dispose, transitionToState, getState, handleTransportUpdated, onTransportUpdate
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section