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

Unified Diff: media/filters/audio_file_reader.h

Issue 2655783004: Decode entire in-memory file for WebAudio (Closed)
Patch Set: Clean up implementation. Created 3 years, 11 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
Index: media/filters/audio_file_reader.h
diff --git a/media/filters/audio_file_reader.h b/media/filters/audio_file_reader.h
index 1e42abd7b018fde25b2d6fce976fa26807de0b63..b920c9eb423dac1e29cea17bd2f4ac6bb4f9c781 100644
--- a/media/filters/audio_file_reader.h
+++ b/media/filters/audio_file_reader.h
@@ -38,6 +38,10 @@ class MEDIA_EXPORT AudioFileReader {
bool Open();
void Close();
+ // Returns true if (an estimated) duration of the audio data is
+ // known. Must be called after Open();
+ bool HasKnownDuration() const;
+
// After a call to Open(), attempts to fully fill |audio_bus| with decoded
// audio data. Any unfilled frames will be zeroed out.
// |audio_data| must be of the same size as channels().
@@ -47,6 +51,8 @@ class MEDIA_EXPORT AudioFileReader {
// <= audio_bus->frames()
int Read(AudioBus* audio_bus);
+ std::unique_ptr<AudioBus> StreamingRead();
+
// These methods can be called once Open() has been called.
int channels() const { return channels_; }
int sample_rate() const { return sample_rate_; }

Powered by Google App Engine
This is Rietveld 408576698