summaryrefslogtreecommitdiffstats
path: root/include/media/ToneGenerator.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-09-07 08:38:38 -0700
committerEric Laurent <elaurent@google.com>2009-09-08 22:56:07 -0700
commit85fa14d35468acca07ce0085d67b909f673fae07 (patch)
tree05de2f3b72a4b488d187c518f2183f0c7986eb1c /include/media/ToneGenerator.h
parentee7347162e02fb1e44526aa0aae9906485ce3950 (diff)
downloadframeworks_av-85fa14d35468acca07ce0085d67b909f673fae07.zip
frameworks_av-85fa14d35468acca07ce0085d67b909f673fae07.tar.gz
frameworks_av-85fa14d35468acca07ce0085d67b909f673fae07.tar.bz2
Fix issue 1992233: DTMF tones on Sholes is really long.
Add a parameter to ToneGenerator.startTone() allowing the caller to specify the tone duration. This is used by the phone application to have a precise control on the DTMF tone duration which was not possible with the use of delayed messaged. Also modified AudioFlinger output threads so that 0s are written to the audio output stream when no more tracks are ready to mix instead of just sleeping. This avoids an issue where the end of a previous DTMF tone could stay in audio hardware buffers and be played just before the beginning of the next DTMF tone.
Diffstat (limited to 'include/media/ToneGenerator.h')
-rw-r--r--include/media/ToneGenerator.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/media/ToneGenerator.h b/include/media/ToneGenerator.h
index eafa661..ea6bf5d 100644
--- a/include/media/ToneGenerator.h
+++ b/include/media/ToneGenerator.h
@@ -154,7 +154,7 @@ public:
ToneGenerator(int streamType, float volume);
~ToneGenerator();
- bool startTone(int toneType);
+ bool startTone(int toneType, int durationMs = -1);
void stopTone();
bool isInited() { return (mState == TONE_IDLE)?false:true;}
@@ -246,6 +246,7 @@ private:
// NOTE: because mTotalSmp, mNextSegSmp are stored on 32 bit, current design will operate properly
// only if tone duration is less than about 27 Hours(@44100Hz sampling rate). If this time is exceeded,
// no crash will occur but tone sequence will show a glitch.
+ unsigned int mMaxSmp; // Maximum number of audio samples played (maximun tone duration)
unsigned short mCurSegment; // Current segment index in ToneDescriptor segments[]
unsigned short mCurCount; // Current sequence repeat count