Skip to content

Commit

Permalink
Adopt absl::string_view in common_audio/
Browse files Browse the repository at this point in the history
Bug: webrtc:13579
Change-Id: I7f9beb34f92d1ea587eda87d1222774ce944a625
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262249
Reviewed-by: Minyue Li <[email protected]>
Commit-Queue: Ali Tofigh <[email protected]>
Cr-Commit-Position: refs/heads/main@{#36886}
  • Loading branch information
Ali Tofigh authored and WebRTC LUCI CQ committed May 13, 2022
1 parent 63ee39d commit 76d84f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions common_audio/wav_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ constexpr size_t kMaxChunksize = 4096;

} // namespace

WavReader::WavReader(const std::string& filename)
WavReader::WavReader(absl::string_view filename)
: WavReader(FileWrapper::OpenReadOnly(filename)) {}

WavReader::WavReader(FileWrapper file) : file_(std::move(file)) {
Expand Down Expand Up @@ -178,7 +178,7 @@ void WavReader::Close() {
file_.Close();
}

WavWriter::WavWriter(const std::string& filename,
WavWriter::WavWriter(absl::string_view filename,
int sample_rate,
size_t num_channels,
SampleFormat sample_format)
Expand Down
4 changes: 2 additions & 2 deletions common_audio/wav_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class WavFile {
class WavWriter final : public WavFile {
public:
// Opens a new WAV file for writing.
WavWriter(const std::string& filename,
WavWriter(absl::string_view filename,
int sample_rate,
size_t num_channels,
SampleFormat sample_format = SampleFormat::kInt16);
Expand Down Expand Up @@ -77,7 +77,7 @@ class WavWriter final : public WavFile {
class WavReader final : public WavFile {
public:
// Opens an existing WAV file for reading.
explicit WavReader(const std::string& filename);
explicit WavReader(absl::string_view filename);
explicit WavReader(FileWrapper file);

// Close the WAV file.
Expand Down

0 comments on commit 76d84f1

Please sign in to comment.