From 7070b36549d511d6627538c73dfbab23fbae5b43 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 16 Jul 2010 07:43:46 -0700 Subject: Added support for auxiliary audio effects to AudioTrack and MediaPlayer. Added methods to AudioTrack and MediaPlayer java classes to enable use of auxiliary audio effects. The effect can be attached and detached by specifying its ID and the send level controlled. Change-Id: Ie74ff54a453096a742688476f612ce355543b6f3 --- include/media/AudioTrack.h | 5 +++-- include/media/IMediaPlayer.h | 2 ++ include/media/mediaplayer.h | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index ef537f4..4475d4a 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -261,8 +261,8 @@ public: /* set the send level for this track. An auxiliary effect should be attached * to the track with attachEffect(). Level must be <= 1.0. */ - status_t setSendLevel(float level); - void getSendLevel(float* level); + status_t setAuxEffectSendLevel(float level); + void getAuxEffectSendLevel(float* level); /* set sample rate for this track, mostly used for games' sound effects */ @@ -479,6 +479,7 @@ private: uint32_t mUpdatePeriod; uint32_t mFlags; int mSessionId; + int mAuxEffectId; }; diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h index 2619691..af9a7ed 100644 --- a/include/media/IMediaPlayer.h +++ b/include/media/IMediaPlayer.h @@ -48,6 +48,8 @@ public: virtual status_t setVolume(float leftVolume, float rightVolume) = 0; virtual status_t suspend() = 0; virtual status_t resume() = 0; + virtual status_t setAuxEffectSendLevel(float level) = 0; + virtual status_t attachAuxEffect(int effectId) = 0; // Invoke a generic method on the player by using opaque parcels // for the request and reply. diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h index 4963f73..207191d 100644 --- a/include/media/mediaplayer.h +++ b/include/media/mediaplayer.h @@ -173,6 +173,8 @@ public: status_t resume(); status_t setAudioSessionId(int sessionId); int getAudioSessionId(); + status_t setAuxEffectSendLevel(float level); + status_t attachAuxEffect(int effectId); private: void clear_l(); status_t seekTo_l(int msec); @@ -200,6 +202,7 @@ private: int mVideoWidth; int mVideoHeight; int mAudioSessionId; + float mSendLevel; }; }; // namespace android -- cgit v1.1