Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: ios/chrome/browser/ui/voice/text_to_speech_player.h

Issue 2449593002: [ios] Adds support for parsing Text-to-Speech search results. (Closed)
Patch Set: Disabled Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/voice/BUILD.gn ('k') | ios/chrome/browser/ui/voice/text_to_speech_player.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/voice/text_to_speech_player.h
diff --git a/ios/chrome/browser/ui/voice/text_to_speech_player.h b/ios/chrome/browser/ui/voice/text_to_speech_player.h
new file mode 100644
index 0000000000000000000000000000000000000000..8940c0a6324acde3f811fd6cf7d80faf64683562
--- /dev/null
+++ b/ios/chrome/browser/ui/voice/text_to_speech_player.h
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_VOICE_TEXT_TO_SPEECH_PLAYER_H_
+#define IOS_CHROME_BROWSER_UI_VOICE_TEXT_TO_SPEECH_PLAYER_H_
+
+#import <Foundation/Foundation.h>
+
+// Class responsible for playing TextToSpeech audio data and emitting audio
+// levels.
+@interface TextToSpeechPlayer : NSObject
+
+// Whether there is audio data prepared to be played.
+@property(nonatomic, readonly, getter=isReadyForPlayback) BOOL readyForPlayback;
+
+// Whether the TextToSpeechPlayer is currently playing audio.
+@property(nonatomic, readonly, getter=isPlayingAudio) BOOL playingAudio;
+
+// Stores a reference to |audioData| and clears up prior TTS state. Calling
+// this function while |playingAudio| is YES will cancel prior playback. This
+// function will post a kTTSAudioReadyForPlaybackNotification notification with
+// the TexToSpeechPlayer used as the sending object.
+- (void)prepareToPlayAudioData:(NSData*)audioData;
+
+// Creates an AVAudioPlayer and begins playing audio data passed to
+// |-prepareToPlayAudioData:|. No-op if called when |readyForPlayback| is NO
+// or |playingAudio| is YES. This function will post a
+// kTTSWillStartPlayingNotification with the TextToSpeechPlayer used as the
+// sending object.
+- (void)beginPlayback;
+
+// Stops any active playback and notifies observers that TTS has stopped. This
+// function will post a kTTSDidStopPlayingNotification notification with the
+// TextToSpeechPlayer used as the sending object.
+- (void)cancelPlayback;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_VOICE_TEXT_TO_SPEECH_PLAYER_H_
« no previous file with comments | « ios/chrome/browser/ui/voice/BUILD.gn ('k') | ios/chrome/browser/ui/voice/text_to_speech_player.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698