FileDocCategorySizeDatePackage
BluetoothAudioConfig.javaAPI DocAndroid 5.1 API3422Thu Mar 12 22:22:10 GMT 2015android.bluetooth

BluetoothAudioConfig

public final class BluetoothAudioConfig extends Object implements android.os.Parcelable
Represents the audio configuration for a Bluetooth A2DP source device. {@see BluetoothA2dpSink} {@hide}

Fields Summary
private final int
mSampleRate
private final int
mChannelConfig
private final int
mAudioFormat
public static final Parcelable.Creator
CREATOR
Constructors Summary
public BluetoothAudioConfig(int sampleRate, int channelConfig, int audioFormat)

        mSampleRate = sampleRate;
        mChannelConfig = channelConfig;
        mAudioFormat = audioFormat;
    
Methods Summary
public intdescribeContents()

        return 0;
    
public booleanequals(java.lang.Object o)

        if (o instanceof BluetoothAudioConfig) {
            BluetoothAudioConfig bac = (BluetoothAudioConfig)o;
            return (bac.mSampleRate == mSampleRate &&
                    bac.mChannelConfig == mChannelConfig &&
                    bac.mAudioFormat == mAudioFormat);
        }
        return false;
    
public intgetAudioFormat()
Returns the channel audio format (either {@link android.media.AudioFormat#ENCODING_PCM_16BIT} or {@link android.media.AudioFormat#ENCODING_PCM_8BIT}

return
audio format

        return mAudioFormat;
    
public intgetChannelConfig()
Returns the channel configuration (either {@link android.media.AudioFormat#CHANNEL_IN_MONO} or {@link android.media.AudioFormat#CHANNEL_IN_STEREO})

return
channel configuration

        return mChannelConfig;
    
public intgetSampleRate()
Returns the sample rate in samples per second

return
sample rate

        return mSampleRate;
    
public inthashCode()

        return mSampleRate | (mChannelConfig << 24) | (mAudioFormat << 28);
    
public java.lang.StringtoString()

        return "{mSampleRate:" + mSampleRate + ",mChannelConfig:" + mChannelConfig
                + ",mAudioFormat:" + mAudioFormat + "}";
    
public voidwriteToParcel(android.os.Parcel out, int flags)


          
        out.writeInt(mSampleRate);
        out.writeInt(mChannelConfig);
        out.writeInt(mAudioFormat);