Code example for MediaPlayer

Methods: getAudioSessionId

0
    } 
 
    public EqualizerController(Context context, MediaPlayer mediaPlayer) {
        this.context = context;
        try { 
			audioSessionId = mediaPlayer.getAudioSessionId();
            equalizer = new Equalizer(0, audioSessionId);
        } catch (Throwable x) {
            Log.w(TAG, "Failed to create equalizer.", x);
        } 
    } 
 
    public void saveSettings() { 
        try { 
            if (isAvailable()) { 
                FileUtil.serialize(context, new EqualizerSettings(equalizer), "equalizer.dat");
            } 
        } catch (Throwable x) {
            Log.w(TAG, "Failed to save equalizer settings.", x);
        } 
    }