Loading media/java/android/media/videoeditor/AudioTrack.java +51 −11 Original line number Diff line number Diff line Loading @@ -35,6 +35,11 @@ public class AudioTrack { private long mEndBoundaryTimeMs; private boolean mLoop; private final int mAudioChannels; private final int mAudioType; private final int mAudioBitrate; private final int mAudioSamplingFrequency; // Ducking variables private int mDuckingThreshold; private int mDuckingLowVolume; Loading @@ -54,7 +59,6 @@ public class AudioTrack { /** * Constructor * * @param audioTrackId The AudioTrack id * @param filename The absolute file name * Loading @@ -68,6 +72,13 @@ public class AudioTrack { mStartTimeMs = 0; // TODO: This value represents to the duration of the audio file mDurationMs = 300000; // TODO: This value needs to be read from the audio track of the source // file mAudioChannels = 2; mAudioType = MediaProperties.ACODEC_AAC_LC; mAudioBitrate = 128000; mAudioSamplingFrequency = 44100; mTimelineDurationMs = mDurationMs; mVolumePercent = 100; Loading Loading @@ -103,6 +114,34 @@ public class AudioTrack { return mFilename; } /** * @return The number of audio channels in the source of this audio track */ public int getAudioChannels() { return mAudioChannels; } /** * @return The audio codec of the source of this audio track */ public int getAudioType() { return mAudioType; } /** * @return The audio sample frequency of the audio track */ public int getAudioSamplingFrequency() { return mAudioSamplingFrequency; } /** * @return The audio bitrate of the audio track */ public int getAudioBitrate() { return mAudioBitrate; } /** * Set the volume of this audio track as percentage of the volume in the * original audio source file. Loading @@ -112,8 +151,8 @@ public class AudioTrack { * is same as original volume. It it is set to 200, then volume * is doubled (provided that volume amplification is supported) * * @throws UnsupportedOperationException if volume amplification is requested * and is not supported. * @throws UnsupportedOperationException if volume amplification is * requested and is not supported. */ public void setVolume(int volumePercent) { mVolumePercent = volumePercent; Loading Loading @@ -209,8 +248,8 @@ public class AudioTrack { /** * Enable the loop mode for this audio track. Note that only one of the * audio tracks in the timeline can have the loop mode enabled. When * looping is enabled the samples between mBeginBoundaryTimeMs and * audio tracks in the timeline can have the loop mode enabled. When looping * is enabled the samples between mBeginBoundaryTimeMs and * mEndBoundaryTimeMs are looped. */ public void enableLoop() { Loading Loading @@ -285,7 +324,8 @@ public class AudioTrack { */ public void extractAudioWaveform(ExtractAudioWaveformProgressListener listener) throws IOException { // TODO: Set mAudioWaveformFilename at the end once the extract is complete // TODO: Set mAudioWaveformFilename at the end once the extract is // complete } /** Loading media/java/android/media/videoeditor/MediaVideoItem.java +2 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,8 @@ public class MediaVideoItem extends MediaItem { private final PlaybackProgressListener mListener; private final int mCallbackAfterFrameCount; private final long mFromMs, mToMs; private boolean mRun, mLoop; private boolean mRun; private final boolean mLoop; private long mPositionMs; /** Loading Loading
media/java/android/media/videoeditor/AudioTrack.java +51 −11 Original line number Diff line number Diff line Loading @@ -35,6 +35,11 @@ public class AudioTrack { private long mEndBoundaryTimeMs; private boolean mLoop; private final int mAudioChannels; private final int mAudioType; private final int mAudioBitrate; private final int mAudioSamplingFrequency; // Ducking variables private int mDuckingThreshold; private int mDuckingLowVolume; Loading @@ -54,7 +59,6 @@ public class AudioTrack { /** * Constructor * * @param audioTrackId The AudioTrack id * @param filename The absolute file name * Loading @@ -68,6 +72,13 @@ public class AudioTrack { mStartTimeMs = 0; // TODO: This value represents to the duration of the audio file mDurationMs = 300000; // TODO: This value needs to be read from the audio track of the source // file mAudioChannels = 2; mAudioType = MediaProperties.ACODEC_AAC_LC; mAudioBitrate = 128000; mAudioSamplingFrequency = 44100; mTimelineDurationMs = mDurationMs; mVolumePercent = 100; Loading Loading @@ -103,6 +114,34 @@ public class AudioTrack { return mFilename; } /** * @return The number of audio channels in the source of this audio track */ public int getAudioChannels() { return mAudioChannels; } /** * @return The audio codec of the source of this audio track */ public int getAudioType() { return mAudioType; } /** * @return The audio sample frequency of the audio track */ public int getAudioSamplingFrequency() { return mAudioSamplingFrequency; } /** * @return The audio bitrate of the audio track */ public int getAudioBitrate() { return mAudioBitrate; } /** * Set the volume of this audio track as percentage of the volume in the * original audio source file. Loading @@ -112,8 +151,8 @@ public class AudioTrack { * is same as original volume. It it is set to 200, then volume * is doubled (provided that volume amplification is supported) * * @throws UnsupportedOperationException if volume amplification is requested * and is not supported. * @throws UnsupportedOperationException if volume amplification is * requested and is not supported. */ public void setVolume(int volumePercent) { mVolumePercent = volumePercent; Loading Loading @@ -209,8 +248,8 @@ public class AudioTrack { /** * Enable the loop mode for this audio track. Note that only one of the * audio tracks in the timeline can have the loop mode enabled. When * looping is enabled the samples between mBeginBoundaryTimeMs and * audio tracks in the timeline can have the loop mode enabled. When looping * is enabled the samples between mBeginBoundaryTimeMs and * mEndBoundaryTimeMs are looped. */ public void enableLoop() { Loading Loading @@ -285,7 +324,8 @@ public class AudioTrack { */ public void extractAudioWaveform(ExtractAudioWaveformProgressListener listener) throws IOException { // TODO: Set mAudioWaveformFilename at the end once the extract is complete // TODO: Set mAudioWaveformFilename at the end once the extract is // complete } /** Loading
media/java/android/media/videoeditor/MediaVideoItem.java +2 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,8 @@ public class MediaVideoItem extends MediaItem { private final PlaybackProgressListener mListener; private final int mCallbackAfterFrameCount; private final long mFromMs, mToMs; private boolean mRun, mLoop; private boolean mRun; private final boolean mLoop; private long mPositionMs; /** Loading