Lines Matching defs:AudioTrack

31  * The AudioTrack class manages and plays a single audio resource for Java applications.
33 * achieved by "pushing" the data to the AudioTrack object using one of the
36 * <p>An AudioTrack instance can operate under two modes: static or streaming.<br>
37 * In Streaming mode, the application writes a continuous stream of data to the AudioTrack, using
54 * <p>Upon creation, an AudioTrack object initializes its associated audio buffer.
55 * The size of this buffer, specified during the construction, determines how long an AudioTrack
57 * For an AudioTrack using the static mode, this size is the maximum size of the sound that can
62 public class AudioTrack
72 /** indicates AudioTrack state is stopped */
74 /** indicates AudioTrack state is paused */
76 /** indicates AudioTrack state is playing */
91 * State of an AudioTrack that was not successfully initialized upon creation.
95 * State of an AudioTrack that is ready to be used.
99 * State of a successfully initialized AudioTrack that uses static data,
130 // to keep in sync with frameworks/base/include/media/AudioTrack.h
140 private final static String TAG = "AudioTrack-Java";
147 * Indicates the state of the AudioTrack instance.
151 * Indicates the play state of the AudioTrack instance.
159 * The listener the AudioTrack notifies when the playback position reaches a marker
177 * Looper associated with the thread that creates the AudioTrack instance.
224 * Accessed by native methods: provides access to C++ AudioTrack object.
230 * the native AudioTrack object, but not stored in it).
254 * from for playback. If using the AudioTrack in streaming mode, you can write data into
255 * this buffer in smaller chunks than this size. If using the AudioTrack in static mode,
258 * for the successful creation of an AudioTrack instance in streaming mode. Using values
263 public AudioTrack(int streamType, int sampleRateInHz, int channelConfig, int audioFormat,
271 * Class constructor with audio session. Use this constructor when the AudioTrack must be
273 * associate audio effects to a particular instance of AudioTrack: if an audio session ID
276 * When an AudioTrack is created without specifying a session, it will create its own session
278 * If a session ID is provided, this AudioTrack will share effects attached to this session
293 * from for playback. If using the AudioTrack in streaming mode, you can write data into
294 * this buffer in smaller chunks than this size. If using the AudioTrack in static mode,
297 * for the successful creation of an AudioTrack instance in streaming mode. Using values
300 * @param sessionId Id of audio session the AudioTrack must be attached to
303 public AudioTrack(int streamType, int sampleRateInHz, int channelConfig, int audioFormat,
308 // remember which looper is associated with the AudioTrack instanciation
324 int initResult = native_setup(new WeakReference<AudioTrack>(this),
328 loge("Error code "+initResult+" when initializing AudioTrack.");
445 * Releases the native AudioTrack resources.
448 // even though native_release() stops the native AudioTrack, we need to stop
449 // AudioTrack subclasses too.
473 return AudioTrack.VOLUME_MIN;
482 return AudioTrack.VOLUME_MAX;
508 * Returns the type of audio stream this AudioTrack is configured for.
535 * Returns the state of the AudioTrack instance. This is useful after the
536 * AudioTrack instance has been created to check if it was initialized
548 * Returns the playback state of the AudioTrack instance.
595 * Returns the minimum buffer size required for the successful creation of an AudioTrack
624 return AudioTrack.ERROR_BAD_VALUE;
630 return AudioTrack.ERROR_BAD_VALUE;
635 return AudioTrack.ERROR_BAD_VALUE;
641 return AudioTrack.ERROR;
651 * @return the ID of the audio session this AudioTrack belongs to.
661 * Sets the listener the AudioTrack notifies when a previously set marker is reached or
663 * Notifications will be received in the same thread as the one in which the AudioTrack
672 * Sets the listener the AudioTrack notifies when a previously set marker is reached or
674 * Use this method to receive AudioTrack events in the Handler associated with another
675 * thread than the one in which you created the AudioTrack instance.
693 * Sets the specified left/right output volume values on the AudioTrack. Values are clamped
808 * Sets the initialization state of the instance. To be used in an AudioTrack subclass
810 * @param state the state of the AudioTrack instance
821 * Starts playing an AudioTrack.
828 throw(new IllegalStateException("play() called on uninitialized AudioTrack."));
845 throw(new IllegalStateException("stop() called on uninitialized AudioTrack."));
865 throw(new IllegalStateException("pause() called on uninitialized AudioTrack."));
967 * layer. This call is only valid with AudioTrack instances that don't use the streaming
1042 * an AudioTrack has reached a notification marker or has increased by a certain period.
1049 void onMarkerReached(AudioTrack track);
1055 void onPeriodicNotification(AudioTrack track);
1067 private final AudioTrack mAudioTrack;
1070 NativeEventHandlerDelegate(AudioTrack track, Handler handler) {
1077 // no given handler, use the looper the AudioTrack was created in
1106 Log.e(TAG, "[ android.media.AudioTrack.NativeEventHandler ] " +
1130 AudioTrack track = (AudioTrack)((WeakReference)audiotrack_ref).get();
1204 Log.d(TAG, "[ android.media.AudioTrack ] " + msg);
1208 Log.e(TAG, "[ android.media.AudioTrack ] " + msg);