IT. Expert System.

Android Reference

AudioTrack


android.media.videoeditor

Class AudioTrack



  • public class AudioTrack
    extends Object
    This class allows to handle an audio track. This audio file is mixed with the audio samples of the media items.
    • Constructor Detail

      • AudioTrack

        public AudioTrack(VideoEditor editor,
                  String audioTrackId,
                  String filename)
                   throws IOException
        Constructor
        Parameters:
        editor - The video editor reference
        audioTrackId - The audio track id
        filename - The absolute file name
        Throws:
        IOException - if file is not found
        IllegalArgumentException - if file format is not supported or if the codec is not supported or if editor is not of type VideoEditorImpl.
    • Method Detail

      • getId

        public String getId()
        Get the id of the audio track
        Returns:
        The id of the audio track
      • getFilename

        public String getFilename()
        Get the filename for this audio track source.
        Returns:
        The filename as an absolute file name
      • getAudioChannels

        public int getAudioChannels()
        Get the number of audio channels in the source of this audio track
        Returns:
        The number of audio channels in the source of this audio track
      • getAudioType

        public int getAudioType()
        Get the audio codec of the source of this audio track
        Returns:
        The audio codec of the source of this audio track MediaProperties
      • getAudioSamplingFrequency

        public int getAudioSamplingFrequency()
        Get the audio sample frequency of the audio track
        Returns:
        The audio sample frequency of the audio track
      • getAudioBitrate

        public int getAudioBitrate()
        Get the audio bitrate of the audio track
        Returns:
        The audio bitrate of the audio track
      • setVolume

        public void setVolume(int volumePercent)
        Set the volume of this audio track as percentage of the volume in the original audio source file.
        Parameters:
        volumePercent - Percentage of the volume to apply. If it is set to 0, then volume becomes mute. It it is set to 100, then volume 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.
      • getVolume

        public int getVolume()
        Get the volume of the audio track as percentage of the volume in the original audio source file.
        Returns:
        The volume in percentage
      • setMute

        public void setMute(boolean muted)
        Mute/Unmute the audio track
        Parameters:
        muted - true to mute the audio track. SetMute(true) will make the volume of this Audio Track to 0.
      • isMuted

        public boolean isMuted()
        Check if the audio track is muted
        Returns:
        true if the audio track is muted
      • getStartTime

        public long getStartTime()
        Get the start time of this audio track relative to the storyboard timeline.
        Returns:
        The start time in milliseconds
      • getDuration

        public long getDuration()
        Get the audio track duration
        Returns:
        The duration in milliseconds. This value represents actual audio track duration. This value is not effected by 'enableLoop' or 'setExtractBoundaries'.
      • getTimelineDuration

        public long getTimelineDuration()
        Get the audio track timeline duration
        Returns:
        The timeline duration as defined by the begin and end boundaries
      • setExtractBoundaries

        public void setExtractBoundaries(long beginMs,
                                long endMs)
        Sets the start and end marks for trimming an audio track
        Parameters:
        beginMs - start time in the audio track in milliseconds (relative to the beginning of the audio track)
        endMs - end time in the audio track in milliseconds (relative to the beginning of the audio track)
      • getBoundaryBeginTime

        public long getBoundaryBeginTime()
        Get the boundary begin time
        Returns:
        The boundary begin time
      • getBoundaryEndTime

        public long getBoundaryEndTime()
        Get the boundary end time
        Returns:
        The boundary end time
      • enableLoop

        public void enableLoop()
        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 mEndBoundaryTimeMs are looped.
      • disableLoop

        public void disableLoop()
        Disable the loop mode
      • isLooping

        public boolean isLooping()
        Check if looping is enabled
        Returns:
        true if looping is enabled
      • disableDucking

        public void disableDucking()
        Disable the audio duck effect
      • enableDucking

        public void enableDucking(int threshold,
                         int duckedTrackVolume)
        Enable ducking by specifying the required parameters
        Parameters:
        threshold - Ducking will be activated when the energy in the media items audio signal goes above this value. The valid range of values is 0db to 90dB. 0dB is equivalent to disabling ducking.
        duckedTrackVolume - The relative volume of the audio track when ducking is active. The valid range of values is 0 to 100.
      • isDuckingEnabled

        public boolean isDuckingEnabled()
        Check if ducking is enabled
        Returns:
        true if ducking is enabled
      • getDuckingThreshhold

        public int getDuckingThreshhold()
        Get the ducking threshold.
        Returns:
        The ducking threshold
      • getDuckedTrackVolume

        public int getDuckedTrackVolume()
        Get the ducked track volume.
        Returns:
        The ducked track volume
      • extractAudioWaveform

        public void extractAudioWaveform(ExtractAudioWaveformProgressListener listener)
                                  throws IOException
        This API allows to generate a file containing the sample volume levels of this audio track object. This function may take significant time and is blocking. The filename can be retrieved using getAudioWaveformFilename().
        Parameters:
        listener - The progress listener
        Throws:
        IOException - if the output file cannot be created
        IllegalArgumentException - if the audio file does not have a valid audio track
        IllegalStateException - if the codec type is unsupported
      • getWaveformData

        public WaveformData getWaveformData()
                                     throws IOException
        Get the audio waveform data.
        Returns:
        The waveform data
        Throws:
        IOException - if the waveform file cannot be found
      • equals

        public boolean equals(Object object)
        Description copied from class: Object
        Compares this instance with the specified object and indicates if they are equal. In order to be equal, o must represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.

        The default implementation returns true only if this == o. See Writing a correct equals method if you intend implementing your own equals method.

        The general contract for the equals and Object.hashCode() methods is that if equals returns true for any two objects, then hashCode() must return the same value for these objects. This means that subclasses of Object usually override either both methods or neither of them.

        Overrides:
        equals in class Object
        Parameters:
        object - the object to compare this instance with.
        Returns:
        true if the specified object is equal to this Object; false otherwise.
        See Also:
        Object.hashCode()
      • hashCode

        public int hashCode()
        Description copied from class: Object
        Returns an integer hash code for this object. By contract, any two objects for which Object.equals(java.lang.Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

        Note that hash values must not change over time unless information used in equals comparisons also changes.

        See Writing a correct hashCode method if you intend implementing your own hashCode method.

        Overrides:
        hashCode in class Object
        Returns:
        this object's hash code.
        See Also:
        Object.equals(java.lang.Object)


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 177 / 158797865. Delta: 0.04356 с