mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Adopt absl::string_view in common_audio/
Bug: webrtc:13579 Change-Id: I7f9beb34f92d1ea587eda87d1222774ce944a625 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262249 Reviewed-by: Minyue Li <minyue@webrtc.org> Commit-Queue: Ali Tofigh <alito@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36886}
This commit is contained in:
parent
63ee39d0be
commit
76d84f122e
2 changed files with 4 additions and 4 deletions
|
@ -65,7 +65,7 @@ constexpr size_t kMaxChunksize = 4096;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
WavReader::WavReader(const std::string& filename)
|
WavReader::WavReader(absl::string_view filename)
|
||||||
: WavReader(FileWrapper::OpenReadOnly(filename)) {}
|
: WavReader(FileWrapper::OpenReadOnly(filename)) {}
|
||||||
|
|
||||||
WavReader::WavReader(FileWrapper file) : file_(std::move(file)) {
|
WavReader::WavReader(FileWrapper file) : file_(std::move(file)) {
|
||||||
|
@ -178,7 +178,7 @@ void WavReader::Close() {
|
||||||
file_.Close();
|
file_.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
WavWriter::WavWriter(const std::string& filename,
|
WavWriter::WavWriter(absl::string_view filename,
|
||||||
int sample_rate,
|
int sample_rate,
|
||||||
size_t num_channels,
|
size_t num_channels,
|
||||||
SampleFormat sample_format)
|
SampleFormat sample_format)
|
||||||
|
|
|
@ -39,7 +39,7 @@ class WavFile {
|
||||||
class WavWriter final : public WavFile {
|
class WavWriter final : public WavFile {
|
||||||
public:
|
public:
|
||||||
// Opens a new WAV file for writing.
|
// Opens a new WAV file for writing.
|
||||||
WavWriter(const std::string& filename,
|
WavWriter(absl::string_view filename,
|
||||||
int sample_rate,
|
int sample_rate,
|
||||||
size_t num_channels,
|
size_t num_channels,
|
||||||
SampleFormat sample_format = SampleFormat::kInt16);
|
SampleFormat sample_format = SampleFormat::kInt16);
|
||||||
|
@ -77,7 +77,7 @@ class WavWriter final : public WavFile {
|
||||||
class WavReader final : public WavFile {
|
class WavReader final : public WavFile {
|
||||||
public:
|
public:
|
||||||
// Opens an existing WAV file for reading.
|
// Opens an existing WAV file for reading.
|
||||||
explicit WavReader(const std::string& filename);
|
explicit WavReader(absl::string_view filename);
|
||||||
explicit WavReader(FileWrapper file);
|
explicit WavReader(FileWrapper file);
|
||||||
|
|
||||||
// Close the WAV file.
|
// Close the WAV file.
|
||||||
|
|
Loading…
Reference in a new issue