OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/audio_modem/modem_impl.h" | 5 #include "components/audio_modem/modem_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 if (audio_type == AUDIBLE) | 55 if (audio_type == AUDIBLE) |
56 return "audible"; | 56 return "audible"; |
57 if (audio_type == INAUDIBLE) | 57 if (audio_type == INAUDIBLE) |
58 return "inaudible"; | 58 return "inaudible"; |
59 | 59 |
60 NOTREACHED() << "Got unexpected token type " << audio_type; | 60 NOTREACHED() << "Got unexpected token type " << audio_type; |
61 return std::string(); | 61 return std::string(); |
62 } | 62 } |
63 | 63 |
64 bool ReadBooleanFlag(const std::string& flag, bool default_value) { | 64 bool ReadBooleanFlag(const std::string& flag, bool default_value) { |
65 const std::string flag_value = base::StringToLowerASCII( | 65 const std::string flag_value = base::ToLowerASCII( |
66 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(flag)); | 66 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(flag)); |
67 if (flag_value == "true" || flag_value == "1") | 67 if (flag_value == "true" || flag_value == "1") |
68 return true; | 68 return true; |
69 if (flag_value == "false" || flag_value == "0") | 69 if (flag_value == "false" || flag_value == "0") |
70 return false; | 70 return false; |
71 LOG_IF(ERROR, !flag_value.empty()) | 71 LOG_IF(ERROR, !flag_value.empty()) |
72 << "Unrecognized value \"" << flag_value << " for flag " | 72 << "Unrecognized value \"" << flag_value << " for flag " |
73 << flag << ". Defaulting to " << default_value; | 73 << flag << ". Defaulting to " << default_value; |
74 return default_value; | 74 return default_value; |
75 } | 75 } |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 file_str = base::SysWideToNativeMB(file_path.value()); | 331 file_str = base::SysWideToNativeMB(file_path.value()); |
332 #else | 332 #else |
333 file_str = dump_tokens_dir_.Append(filename).value(); | 333 file_str = dump_tokens_dir_.Append(filename).value(); |
334 #endif | 334 #endif |
335 | 335 |
336 webrtc::WavWriter writer(file_str, kDefaultSampleRate, kMonoChannelCount); | 336 webrtc::WavWriter writer(file_str, kDefaultSampleRate, kMonoChannelCount); |
337 writer.WriteSamples(int_samples.data(), int_samples.size()); | 337 writer.WriteSamples(int_samples.data(), int_samples.size()); |
338 } | 338 } |
339 | 339 |
340 } // namespace audio_modem | 340 } // namespace audio_modem |
OLD | NEW |