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 */
92 * State of an AudioTrack that was not successfully initialized upon creation.
96 * State of an AudioTrack that is ready to be used.
100 * State of a successfully initialized AudioTrack that uses static data,
131 // to keep in sync with frameworks/base/include/media/AudioTrack.h
141 private final static String TAG = "AudioTrack-Java";
148 * Indicates the state of the AudioTrack instance.
152 * Indicates the play state of the AudioTrack instance.
160 * The listener the AudioTrack notifies when the playback position reaches a marker
178 * Looper associated with the thread that creates the AudioTrack instance.
226 * Accessed by native methods: provides access to C++ AudioTrack object.
232 * the native AudioTrack object, but not stored in it).
255 * from for playback. If using the AudioTrack in streaming mode, you can write data into
256 * this buffer in smaller chunks than this size. If using the AudioTrack in static mode,
259 * for the successful creation of an AudioTrack instance in streaming mode. Using values
264 public AudioTrack(int streamType, int sampleRateInHz, int channelConfig, int audioFormat,
272 * Class constructor with audio session. Use this constructor when the AudioTrack must be
274 * associate audio effects to a particular instance of AudioTrack: if an audio session ID
277 * When an AudioTrack is created without specifying a session, it will create its own session
279 * If a non-zero session ID is provided, this AudioTrack will share effects attached to this
295 * from for playback. If using the AudioTrack in streaming mode, you can write data into
296 * this buffer in smaller chunks than this size. If using the AudioTrack in static mode,
299 * for the successful creation of an AudioTrack instance in streaming mode. Using values
302 * @param sessionId Id of audio session the AudioTrack must be attached to
305 public AudioTrack(int streamType, int sampleRateInHz, int channelConfig, int audioFormat,
310 // remember which looper is associated with the AudioTrack instantiation
326 int initResult = native_setup(new WeakReference<AudioTrack>(this),
330 loge("Error code "+initResult+" when initializing AudioTrack.");
444 * @return false if the AudioTrack can't be used with such a mask
493 * Releases the native AudioTrack resources.
496 // even though native_release() stops the native AudioTrack, we need to stop
497 // AudioTrack subclasses too.
521 return AudioTrack.VOLUME_MIN;
530 return AudioTrack.VOLUME_MAX;
556 * Returns the type of audio stream this AudioTrack is configured for.
584 * Returns the state of the AudioTrack instance. This is useful after the
585 * AudioTrack instance has been created to check if it was initialized
597 * Returns the playback state of the AudioTrack instance.
644 * Returns the minimum buffer size required for the successful creation of an AudioTrack
675 return AudioTrack.ERROR_BAD_VALUE;
684 return AudioTrack.ERROR_BAD_VALUE;
690 return AudioTrack.ERROR_BAD_VALUE;
696 return AudioTrack.ERROR;
706 * @return the ID of the audio session this AudioTrack belongs to.
716 * Sets the listener the AudioTrack notifies when a previously set marker is reached or
718 * Notifications will be received in the same thread as the one in which the AudioTrack
727 * Sets the listener the AudioTrack notifies when a previously set marker is reached or
729 * Use this method to receive AudioTrack events in the Handler associated with another
730 * thread than the one in which you created the AudioTrack instance.
748 * Sets the specified left/right output volume values on the AudioTrack. Values are clamped
863 * Sets the initialization state of the instance. To be used in an AudioTrack subclass
865 * @param state the state of the AudioTrack instance
876 * Starts playing an AudioTrack.
883 throw(new IllegalStateException("play() called on uninitialized AudioTrack."));
903 throw(new IllegalStateException("stop() called on uninitialized AudioTrack."));
923 throw(new IllegalStateException("pause() called on uninitialized AudioTrack."));
1025 * layer. This call is only valid with AudioTrack instances that don't use the streaming
1100 * an AudioTrack has reached a notification marker or has increased by a certain period.
1107 void onMarkerReached(AudioTrack track);
1113 void onPeriodicNotification(AudioTrack track);
1125 private final AudioTrack mAudioTrack;
1128 NativeEventHandlerDelegate(AudioTrack track, Handler handler) {
1135 // no given handler, use the looper the AudioTrack was created in
1164 Log.e(TAG, "[ android.media.AudioTrack.NativeEventHandler ] " +
1188 AudioTrack track = (AudioTrack)((WeakReference)audiotrack_ref).get();
1262 Log.d(TAG, "[ android.media.AudioTrack ] " + msg);
1266 Log.e(TAG, "[ android.media.AudioTrack ] " + msg);