Move remaining traces of VoiceEngine

- Move files from voice_engine/ to audio/.
- Rename voice_engine/utility.* to remix_resample.* since there are no other
  utilities in those files.
- Move test/mock_voe_channel_proxy.h to audio/.
- Removed voe_channel_id from Audio[Receive|Send]Stream::Config.
- Remove VoiceEngine* from AudioState::Config.
- Fix a few cpplint complaints which showed when moving files.

NOPRESUBMIT=true

Bug: webrtc:4690
Change-Id: Id266c822d956625c358fa5e193e6f4837164aef8
Reviewed-on: https://webrtc-review.googlesource.com/39268
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21657}
diff --git a/.gn b/.gn
index 5e3c6ca..e1ed9ae 100644
--- a/.gn
+++ b/.gn
@@ -42,7 +42,6 @@
   "//system_wrappers/*",
   "//test/*",
   "//video/*",
-  "//voice_engine/*",
   "//third_party/libyuv/*",
 ]
 
diff --git a/BUILD.gn b/BUILD.gn
index 4e6f01b..bb5c953 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -63,7 +63,6 @@
         "video:screenshare_loopback",
         "video:sv_loopback",
         "video:video_loopback",
-        "voice_engine:voice_engine_unittests",
       ]
       if (is_android) {
         deps += [
@@ -342,7 +341,6 @@
       "sdk",
       "system_wrappers:system_wrappers_default",
       "video",
-      "voice_engine",
     ]
 
     if (build_with_mozilla) {
diff --git a/WATCHLISTS b/WATCHLISTS
index ed0a614..b6a5703 100644
--- a/WATCHLISTS
+++ b/WATCHLISTS
@@ -23,8 +23,7 @@
       'filepath': '^[^/]*$|^webrtc/[^/]*$|^webrtc/build/.*',
     },
     'documented_interfaces': {
-      'filepath': '^webrtc/[^/]*\.h$|'\
-                  'webrtc/voice_engine/include/.*',
+      'filepath': '^webrtc/[^/]*\.h$',
     },
     'build_files': {
       'filepath': '\.gyp$|\.gypi$|Android\.mk$',
@@ -50,9 +49,6 @@
     'video': {
       'filepath': 'webrtc/video/.*',
     },
-    'voice_engine': {
-      'filepath': 'webrtc/voice_engine/.*',
-    },
     'common_audio': {
       'filepath': 'webrtc/common_audio/.*',
     },
@@ -126,20 +122,11 @@
     'call': ['mflodman@webrtc.org',
              'solenberg@webrtc.org',
              'stefan@webrtc.org'],
-    'media_engine': ['solenberg@webrtc.org'],
     'video': ['mflodman@webrtc.org',
               'stefan@webrtc.org',
               'video-team@agora.io',
               'yujie.mao@webrtc.org',
               'zhengzhonghou@agora.io'],
-    'voice_engine': ['alessiob@webrtc.org',
-                     'andrew@webrtc.org',
-                     'audio-team@agora.io',
-                     'henrika@webrtc.org',
-                     'henrik.lundin@webrtc.org',
-                     'minyue@webrtc.org',
-                     'peah@webrtc.org',
-                     'solenberg@webrtc.org'],
     'video_capture': ['mflodman@webrtc.org',
                       'perkj@webrtc.org',
                       'sdk-team@agora.io',
diff --git a/api/DEPS b/api/DEPS
index a537633..5ac116c 100644
--- a/api/DEPS
+++ b/api/DEPS
@@ -7,10 +7,6 @@
 ]
 
 specific_include_rules = {
-  "peerconnection_jni\.cc": [
-    "+voice_engine",
-  ],
-
   # TODO(ossu): Remove this exception when {builtin_,}audio_encoder_factory.h
   # has moved to api/.
   "peerconnectioninterface\.h": [
diff --git a/audio/BUILD.gn b/audio/BUILD.gn
index d3af836..2eee20b 100644
--- a/audio/BUILD.gn
+++ b/audio/BUILD.gn
@@ -14,6 +14,8 @@
 
 rtc_static_library("audio") {
   sources = [
+    "audio_level.cc",
+    "audio_level.h",
     "audio_receive_stream.cc",
     "audio_receive_stream.h",
     "audio_send_stream.cc",
@@ -22,11 +24,19 @@
     "audio_state.h",
     "audio_transport_impl.cc",
     "audio_transport_impl.h",
+    "channel.cc",
+    "channel.h",
+    "channel_proxy.cc",
+    "channel_proxy.h",
     "conversion.h",
     "null_audio_poller.cc",
     "null_audio_poller.h",
+    "remix_resample.cc",
+    "remix_resample.h",
     "time_interval.cc",
     "time_interval.h",
+    "transport_feedback_packet_loss_tracker.cc",
+    "transport_feedback_packet_loss_tracker.h",
   ]
 
   if (!build_with_chromium && is_clang) {
@@ -36,15 +46,23 @@
 
   deps = [
     "..:webrtc_common",
+    "../api:array_view",
     "../api:audio_mixer_api",
     "../api:call_api",
+    "../api:libjingle_peerconnection_api",
     "../api:optional",
+    "../api:transport_api",
     "../api/audio_codecs:audio_codecs_api",
     "../api/audio_codecs:builtin_audio_encoder_factory",
     "../call:bitrate_allocator",
     "../call:call_interfaces",
     "../call:rtp_interfaces",
     "../common_audio",
+    "../logging:rtc_event_log_api",
+    "../modules:module_api",
+    "../modules/audio_coding",
+    "../modules/audio_coding:audio_format_conversion",
+    "../modules/audio_coding:audio_network_adaptor_config",
     "../modules/audio_coding:cng",
     "../modules/audio_device",
     "../modules/audio_processing",
@@ -53,14 +71,16 @@
     "../modules/pacing:pacing",
     "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
     "../modules/rtp_rtcp",
+    "../modules/rtp_rtcp:rtp_rtcp_format",
+    "../modules/utility",
     "../rtc_base:checks",
+    "../rtc_base:rate_limiter",
     "../rtc_base:rtc_base",
     "../rtc_base:rtc_base_approved",
     "../rtc_base:rtc_task_queue",
     "../system_wrappers",
     "../system_wrappers:field_trial_api",
-    "../voice_engine",
-    "../voice_engine:audio_level",
+    "../system_wrappers:metrics_api",
     "utility:audio_frame_operations",
   ]
 }
@@ -94,7 +114,10 @@
       "audio_send_stream_tests.cc",
       "audio_send_stream_unittest.cc",
       "audio_state_unittest.cc",
+      "mock_voe_channel_proxy.h",
+      "remix_resample_unittest.cc",
       "time_interval_unittest.cc",
+      "transport_feedback_packet_loss_tracker_unittest.cc",
     ]
     deps = [
       ":audio",
@@ -104,7 +127,9 @@
       "../call:mock_rtp_interfaces",
       "../call:rtp_interfaces",
       "../call:rtp_receiver",
+      "../common_audio",
       "../logging:mocks",
+      "../modules:module_api",
       "../modules/audio_device:mock_audio_device",
       "../modules/audio_mixer:audio_mixer_impl",
       "../modules/audio_processing:audio_processing_statistics",
@@ -116,6 +141,7 @@
       "../modules/pacing:pacing",
       "../modules/rtp_rtcp:mock_rtp_rtcp",
       "../modules/rtp_rtcp:rtp_rtcp_format",
+      "../rtc_base:checks",
       "../rtc_base:rtc_base_approved",
       "../rtc_base:rtc_base_tests_utils",
       "../rtc_base:rtc_task_queue",
@@ -125,7 +151,6 @@
       "../test:rtp_test_utils",
       "../test:test_common",
       "../test:test_support",
-      "../voice_engine",
       "utility:utility_tests",
       "//testing/gmock",
       "//testing/gtest",
diff --git a/audio/DEPS b/audio/DEPS
index 70e3346..8bb1f80 100644
--- a/audio/DEPS
+++ b/audio/DEPS
@@ -5,14 +5,15 @@
   "+modules/audio_coding",
   "+modules/audio_device",
   "+modules/audio_mixer",
+  "+modules/audio_processing",
   "+modules/audio_processing/include",
   "+modules/bitrate_controller",
   "+modules/congestion_controller",
   "+modules/pacing",
   "+modules/remote_bitrate_estimator",
   "+modules/rtp_rtcp",
+  "+modules/utility",
   "+system_wrappers",
-  "+voice_engine",
 ]
 
 specific_include_rules = {
diff --git a/voice_engine/audio_level.cc b/audio/audio_level.cc
similarity index 98%
rename from voice_engine/audio_level.cc
rename to audio/audio_level.cc
index 57b4855..fe2a240 100644
--- a/voice_engine/audio_level.cc
+++ b/audio/audio_level.cc
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "voice_engine/audio_level.h"
+#include "audio/audio_level.h"
 
 #include "common_audio/signal_processing/include/signal_processing_library.h"
 #include "modules/include/module_common_types.h"
diff --git a/voice_engine/audio_level.h b/audio/audio_level.h
similarity index 91%
rename from voice_engine/audio_level.h
rename to audio/audio_level.h
index a1951ed..883641a 100644
--- a/voice_engine/audio_level.h
+++ b/audio/audio_level.h
@@ -8,12 +8,11 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifndef VOICE_ENGINE_AUDIO_LEVEL_H_
-#define VOICE_ENGINE_AUDIO_LEVEL_H_
+#ifndef AUDIO_AUDIO_LEVEL_H_
+#define AUDIO_AUDIO_LEVEL_H_
 
 #include "rtc_base/criticalsection.h"
 #include "rtc_base/thread_annotations.h"
-#include "typedefs.h"  // NOLINT(build/include)
 
 namespace webrtc {
 
@@ -57,4 +56,4 @@
 }  // namespace voe
 }  // namespace webrtc
 
-#endif  // VOICE_ENGINE_AUDIO_LEVEL_H_
+#endif  // AUDIO_AUDIO_LEVEL_H_
diff --git a/audio/audio_receive_stream.cc b/audio/audio_receive_stream.cc
index 294dad0..45ffe34 100644
--- a/audio/audio_receive_stream.cc
+++ b/audio/audio_receive_stream.cc
@@ -16,6 +16,7 @@
 #include "api/call/audio_sink.h"
 #include "audio/audio_send_stream.h"
 #include "audio/audio_state.h"
+#include "audio/channel_proxy.h"
 #include "audio/conversion.h"
 #include "call/rtp_stream_receiver_controller_interface.h"
 #include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
@@ -24,7 +25,6 @@
 #include "rtc_base/checks.h"
 #include "rtc_base/logging.h"
 #include "rtc_base/timeutils.h"
-#include "voice_engine/channel_proxy.h"
 
 namespace webrtc {
 
diff --git a/audio/audio_receive_stream_unittest.cc b/audio/audio_receive_stream_unittest.cc
index c8318aa..fa663fe 100644
--- a/audio/audio_receive_stream_unittest.cc
+++ b/audio/audio_receive_stream_unittest.cc
@@ -15,6 +15,7 @@
 #include "api/test/mock_audio_mixer.h"
 #include "audio/audio_receive_stream.h"
 #include "audio/conversion.h"
+#include "audio/mock_voe_channel_proxy.h"
 #include "call/rtp_stream_receiver_controller.h"
 #include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
 #include "modules/audio_device/include/mock_audio_device.h"
@@ -24,7 +25,6 @@
 #include "modules/rtp_rtcp/source/byte_io.h"
 #include "test/gtest.h"
 #include "test/mock_audio_decoder_factory.h"
-#include "test/mock_voe_channel_proxy.h"
 
 namespace webrtc {
 namespace test {
diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc
index d207dbd..80c2c6b 100644
--- a/audio/audio_send_stream.cc
+++ b/audio/audio_send_stream.cc
@@ -15,6 +15,7 @@
 #include <vector>
 
 #include "audio/audio_state.h"
+#include "audio/channel_proxy.h"
 #include "audio/conversion.h"
 #include "call/rtp_transport_controller_send_interface.h"
 #include "modules/audio_coding/codecs/cng/audio_encoder_cng.h"
@@ -28,7 +29,6 @@
 #include "rtc_base/task_queue.h"
 #include "rtc_base/timeutils.h"
 #include "system_wrappers/include/field_trial.h"
-#include "voice_engine/channel_proxy.h"
 
 namespace webrtc {
 namespace internal {
diff --git a/audio/audio_send_stream.h b/audio/audio_send_stream.h
index bab8f80..093ca46 100644
--- a/audio/audio_send_stream.h
+++ b/audio/audio_send_stream.h
@@ -15,6 +15,7 @@
 #include <vector>
 
 #include "audio/time_interval.h"
+#include "audio/transport_feedback_packet_loss_tracker.h"
 #include "call/audio_send_stream.h"
 #include "call/audio_state.h"
 #include "call/bitrate_allocator.h"
@@ -22,7 +23,6 @@
 #include "rtc_base/constructormagic.h"
 #include "rtc_base/race_checker.h"
 #include "rtc_base/thread_checker.h"
-#include "voice_engine/transport_feedback_packet_loss_tracker.h"
 
 namespace webrtc {
 class RtcEventLog;
diff --git a/audio/audio_send_stream_unittest.cc b/audio/audio_send_stream_unittest.cc
index 4644bf4..925f93e 100644
--- a/audio/audio_send_stream_unittest.cc
+++ b/audio/audio_send_stream_unittest.cc
@@ -15,6 +15,7 @@
 #include "audio/audio_send_stream.h"
 #include "audio/audio_state.h"
 #include "audio/conversion.h"
+#include "audio/mock_voe_channel_proxy.h"
 #include "call/fake_rtp_transport_controller_send.h"
 #include "call/rtp_transport_controller_send_interface.h"
 #include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
@@ -32,7 +33,6 @@
 #include "test/gtest.h"
 #include "test/mock_audio_encoder.h"
 #include "test/mock_audio_encoder_factory.h"
-#include "test/mock_voe_channel_proxy.h"
 
 namespace webrtc {
 namespace test {
diff --git a/audio/audio_transport_impl.cc b/audio/audio_transport_impl.cc
index 30ffc6d..f9b0311 100644
--- a/audio/audio_transport_impl.cc
+++ b/audio/audio_transport_impl.cc
@@ -14,10 +14,10 @@
 #include <memory>
 #include <utility>
 
+#include "audio/remix_resample.h"
 #include "audio/utility/audio_frame_operations.h"
 #include "call/audio_send_stream.h"
 #include "rtc_base/logging.h"
-#include "voice_engine/utility.h"
 
 namespace webrtc {
 
diff --git a/audio/audio_transport_impl.h b/audio/audio_transport_impl.h
index 8a316a5..4e6e047 100644
--- a/audio/audio_transport_impl.h
+++ b/audio/audio_transport_impl.h
@@ -14,6 +14,7 @@
 #include <vector>
 
 #include "api/audio/audio_mixer.h"
+#include "audio/audio_level.h"
 #include "common_audio/resampler/include/push_resampler.h"
 #include "modules/audio_device/include/audio_device.h"
 #include "modules/audio_processing/include/audio_processing.h"
@@ -22,7 +23,6 @@
 #include "rtc_base/criticalsection.h"
 #include "rtc_base/scoped_ref_ptr.h"
 #include "rtc_base/thread_annotations.h"
-#include "voice_engine/audio_level.h"
 
 namespace webrtc {
 
diff --git a/voice_engine/channel.cc b/audio/channel.cc
similarity index 98%
rename from voice_engine/channel.cc
rename to audio/channel.cc
index efc76bd..1799e7a 100644
--- a/voice_engine/channel.cc
+++ b/audio/channel.cc
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "voice_engine/channel.h"
+#include "audio/channel.h"
 
 #include <algorithm>
 #include <map>
@@ -365,10 +365,7 @@
     return false;
   }
 
-  uint8_t* bufferToSendPtr = (uint8_t*)data;
-  size_t bufferLength = len;
-
-  if (!_transportPtr->SendRtp(bufferToSendPtr, bufferLength, options)) {
+  if (!_transportPtr->SendRtp(data, len, options)) {
     RTC_LOG(LS_ERROR) << "Channel::SendPacket() RTP transmission failed";
     return false;
   }
@@ -383,10 +380,7 @@
     return false;
   }
 
-  uint8_t* bufferToSendPtr = (uint8_t*)data;
-  size_t bufferLength = len;
-
-  int n = _transportPtr->SendRtcp(bufferToSendPtr, bufferLength);
+  int n = _transportPtr->SendRtcp(data, len);
   if (n < 0) {
     RTC_LOG(LS_ERROR) << "Channel::SendRtcp() transmission failed";
     return false;
diff --git a/voice_engine/channel.h b/audio/channel.h
similarity index 98%
rename from voice_engine/channel.h
rename to audio/channel.h
index 3d6dd8f..c5d243c 100644
--- a/voice_engine/channel.h
+++ b/audio/channel.h
@@ -8,16 +8,20 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifndef VOICE_ENGINE_CHANNEL_H_
-#define VOICE_ENGINE_CHANNEL_H_
+#ifndef AUDIO_CHANNEL_H_
+#define AUDIO_CHANNEL_H_
 
+#include <map>
 #include <memory>
+#include <string>
+#include <vector>
 
 #include "api/audio/audio_mixer.h"
 #include "api/audio_codecs/audio_encoder.h"
 #include "api/call/audio_sink.h"
 #include "api/call/transport.h"
 #include "api/optional.h"
+#include "audio/audio_level.h"
 #include "common_types.h"  // NOLINT(build/include)
 #include "modules/audio_coding/include/audio_coding_module.h"
 #include "modules/audio_processing/rms_level.h"
@@ -29,7 +33,6 @@
 #include "rtc_base/event.h"
 #include "rtc_base/task_queue.h"
 #include "rtc_base/thread_checker.h"
-#include "voice_engine/audio_level.h"
 
 namespace rtc {
 class TimestampWrapAroundHandler;
@@ -410,4 +413,4 @@
 }  // namespace voe
 }  // namespace webrtc
 
-#endif  // VOICE_ENGINE_CHANNEL_H_
+#endif  // AUDIO_CHANNEL_H_
diff --git a/voice_engine/channel_proxy.cc b/audio/channel_proxy.cc
similarity index 99%
rename from voice_engine/channel_proxy.cc
rename to audio/channel_proxy.cc
index 70564d4..cdfe090 100644
--- a/voice_engine/channel_proxy.cc
+++ b/audio/channel_proxy.cc
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "voice_engine/channel_proxy.h"
+#include "audio/channel_proxy.h"
 
 #include <utility>
 
diff --git a/voice_engine/channel_proxy.h b/audio/channel_proxy.h
similarity index 97%
rename from voice_engine/channel_proxy.h
rename to audio/channel_proxy.h
index ef81174..f5f603b 100644
--- a/voice_engine/channel_proxy.h
+++ b/audio/channel_proxy.h
@@ -8,9 +8,10 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifndef VOICE_ENGINE_CHANNEL_PROXY_H_
-#define VOICE_ENGINE_CHANNEL_PROXY_H_
+#ifndef AUDIO_CHANNEL_PROXY_H_
+#define AUDIO_CHANNEL_PROXY_H_
 
+#include <map>
 #include <memory>
 #include <string>
 #include <vector>
@@ -18,11 +19,11 @@
 #include "api/audio/audio_mixer.h"
 #include "api/audio_codecs/audio_encoder.h"
 #include "api/rtpreceiverinterface.h"
+#include "audio/channel.h"
 #include "call/rtp_packet_sink_interface.h"
 #include "rtc_base/constructormagic.h"
 #include "rtc_base/race_checker.h"
 #include "rtc_base/thread_checker.h"
-#include "voice_engine/channel.h"
 
 namespace webrtc {
 
@@ -141,4 +142,4 @@
 }  // namespace voe
 }  // namespace webrtc
 
-#endif  // VOICE_ENGINE_CHANNEL_PROXY_H_
+#endif  // AUDIO_CHANNEL_PROXY_H_
diff --git a/test/mock_voe_channel_proxy.h b/audio/mock_voe_channel_proxy.h
similarity index 95%
rename from test/mock_voe_channel_proxy.h
rename to audio/mock_voe_channel_proxy.h
index 29635ba..d512ad4 100644
--- a/test/mock_voe_channel_proxy.h
+++ b/audio/mock_voe_channel_proxy.h
@@ -8,14 +8,17 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifndef TEST_MOCK_VOE_CHANNEL_PROXY_H_
-#define TEST_MOCK_VOE_CHANNEL_PROXY_H_
+#ifndef AUDIO_MOCK_VOE_CHANNEL_PROXY_H_
+#define AUDIO_MOCK_VOE_CHANNEL_PROXY_H_
 
+#include <map>
+#include <memory>
 #include <string>
+#include <vector>
 
+#include "audio/channel_proxy.h"
 #include "modules/rtp_rtcp/source/rtp_packet_received.h"
 #include "test/gmock.h"
-#include "voice_engine/channel_proxy.h"
 
 namespace webrtc {
 namespace test {
@@ -101,4 +104,4 @@
 }  // namespace test
 }  // namespace webrtc
 
-#endif  // TEST_MOCK_VOE_CHANNEL_PROXY_H_
+#endif  // AUDIO_MOCK_VOE_CHANNEL_PROXY_H_
diff --git a/voice_engine/utility.cc b/audio/remix_resample.cc
similarity index 98%
rename from voice_engine/utility.cc
rename to audio/remix_resample.cc
index 9398702..52a491f 100644
--- a/voice_engine/utility.cc
+++ b/audio/remix_resample.cc
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "voice_engine/utility.h"
+#include "audio/remix_resample.h"
 
 #include "audio/utility/audio_frame_operations.h"
 #include "common_audio/resampler/include/push_resampler.h"
diff --git a/voice_engine/utility.h b/audio/remix_resample.h
similarity index 86%
rename from voice_engine/utility.h
rename to audio/remix_resample.h
index dc23e16..ddd8086 100644
--- a/voice_engine/utility.h
+++ b/audio/remix_resample.h
@@ -8,15 +8,10 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-/*
- *  Contains functions often used by different parts of VoiceEngine.
- */
-
-#ifndef VOICE_ENGINE_UTILITY_H_
-#define VOICE_ENGINE_UTILITY_H_
+#ifndef AUDIO_REMIX_RESAMPLE_H_
+#define AUDIO_REMIX_RESAMPLE_H_
 
 #include "common_audio/resampler/include/push_resampler.h"
-#include "typedefs.h"  // NOLINT(build/include)
 
 namespace webrtc {
 
@@ -48,4 +43,4 @@
 }  // namespace voe
 }  // namespace webrtc
 
-#endif  // VOICE_ENGINE_UTILITY_H_
+#endif  // AUDIO_REMIX_RESAMPLE_H_
diff --git a/voice_engine/utility_unittest.cc b/audio/remix_resample_unittest.cc
similarity index 98%
rename from voice_engine/utility_unittest.cc
rename to audio/remix_resample_unittest.cc
index c798582..753584b 100644
--- a/voice_engine/utility_unittest.cc
+++ b/audio/remix_resample_unittest.cc
@@ -10,12 +10,12 @@
 
 #include <math.h>
 
+#include "audio/remix_resample.h"
 #include "common_audio/resampler/include/push_resampler.h"
 #include "modules/include/module_common_types.h"
 #include "rtc_base/arraysize.h"
 #include "rtc_base/format_macros.h"
 #include "test/gtest.h"
-#include "voice_engine/utility.h"
 
 namespace webrtc {
 namespace voe {
diff --git a/voice_engine/transport_feedback_packet_loss_tracker.cc b/audio/transport_feedback_packet_loss_tracker.cc
similarity index 99%
rename from voice_engine/transport_feedback_packet_loss_tracker.cc
rename to audio/transport_feedback_packet_loss_tracker.cc
index 774faf5..101b6b4 100644
--- a/voice_engine/transport_feedback_packet_loss_tracker.cc
+++ b/audio/transport_feedback_packet_loss_tracker.cc
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "voice_engine/transport_feedback_packet_loss_tracker.h"
+#include "audio/transport_feedback_packet_loss_tracker.h"
 
 #include <limits>
 #include <utility>
diff --git a/voice_engine/transport_feedback_packet_loss_tracker.h b/audio/transport_feedback_packet_loss_tracker.h
similarity index 95%
rename from voice_engine/transport_feedback_packet_loss_tracker.h
rename to audio/transport_feedback_packet_loss_tracker.h
index d742078..7e73210 100644
--- a/voice_engine/transport_feedback_packet_loss_tracker.h
+++ b/audio/transport_feedback_packet_loss_tracker.h
@@ -8,10 +8,11 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifndef VOICE_ENGINE_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_
-#define VOICE_ENGINE_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_
+#ifndef AUDIO_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_
+#define AUDIO_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_
 
 #include <map>
+#include <vector>
 
 #include "api/optional.h"
 #include "modules/include/module_common_types.h"
@@ -138,4 +139,4 @@
 
 }  // namespace webrtc
 
-#endif  // VOICE_ENGINE_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_
+#endif  // AUDIO_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_
diff --git a/voice_engine/transport_feedback_packet_loss_tracker_unittest.cc b/audio/transport_feedback_packet_loss_tracker_unittest.cc
similarity index 99%
rename from voice_engine/transport_feedback_packet_loss_tracker_unittest.cc
rename to audio/transport_feedback_packet_loss_tracker_unittest.cc
index 55626be..8f8fe05 100644
--- a/voice_engine/transport_feedback_packet_loss_tracker_unittest.cc
+++ b/audio/transport_feedback_packet_loss_tracker_unittest.cc
@@ -13,12 +13,12 @@
 #include <numeric>
 #include <vector>
 
+#include "audio/transport_feedback_packet_loss_tracker.h"
 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
 #include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
 #include "rtc_base/checks.h"
 #include "test/gmock.h"
 #include "test/gtest.h"
-#include "voice_engine/transport_feedback_packet_loss_tracker.h"
 
 namespace webrtc {
 
diff --git a/call/BUILD.gn b/call/BUILD.gn
index d7ed4d9..03ed9b4 100644
--- a/call/BUILD.gn
+++ b/call/BUILD.gn
@@ -271,7 +271,6 @@
       "../test:test_support",
       "../test:video_test_common",
       "../video",
-      "../voice_engine",
       "//testing/gtest",
     ]
     if (!build_with_chromium && is_clang) {
diff --git a/call/DEPS b/call/DEPS
index 7622e24..307a26e 100644
--- a/call/DEPS
+++ b/call/DEPS
@@ -11,7 +11,6 @@
   "+modules/rtp_rtcp",
   "+modules/utility",
   "+system_wrappers",
-  "+voice_engine",
   "+video",
 ]
 
diff --git a/call/audio_receive_stream.h b/call/audio_receive_stream.h
index f8d787c..4667498 100644
--- a/call/audio_receive_stream.h
+++ b/call/audio_receive_stream.h
@@ -98,9 +98,6 @@
 
     Transport* rtcp_send_transport = nullptr;
 
-    // TODO(solenberg): Remove once clients don't use it anymore.
-    int voe_channel_id = -1;
-
     // NetEq settings.
     size_t jitter_buffer_max_packets = 50;
     bool jitter_buffer_fast_accelerate = false;
diff --git a/call/audio_send_stream.h b/call/audio_send_stream.h
index 03f32b7..908da11 100644
--- a/call/audio_send_stream.h
+++ b/call/audio_send_stream.h
@@ -87,9 +87,6 @@
     // the entire life of the AudioSendStream and is owned by the API client.
     Transport* send_transport = nullptr;
 
-    // TODO(solenberg): Remove once clients don't use it anymore.
-    int voe_channel_id = -1;
-
     // Bitrate limits used for variable audio bitrate streams. Set both to -1 to
     // disable audio bitrate adaptation.
     // Note: This is still an experimental feature and not ready for real usage.
diff --git a/call/audio_state.h b/call/audio_state.h
index a8e57f0..9c40187 100644
--- a/call/audio_state.h
+++ b/call/audio_state.h
@@ -19,16 +19,12 @@
 class AudioDeviceModule;
 class AudioProcessing;
 class AudioTransport;
-class VoiceEngine;
 
 // AudioState holds the state which must be shared between multiple instances of
 // webrtc::Call for audio processing purposes.
 class AudioState : public rtc::RefCountInterface {
  public:
   struct Config {
-    // TODO(solenberg): Remove once clients don't use it anymore.
-    VoiceEngine* voice_engine = nullptr;
-
     // The audio mixer connected to active receive streams. One per
     // AudioState.
     rtc::scoped_refptr<AudioMixer> audio_mixer;
diff --git a/media/BUILD.gn b/media/BUILD.gn
index b7ea5af..bfd91ce 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -317,7 +317,6 @@
     "../system_wrappers",
     "../system_wrappers:field_trial_api",
     "../system_wrappers:metrics_api",
-    "../voice_engine",
   ]
 }
 
@@ -616,7 +615,6 @@
       "../test:audio_codec_mocks",
       "../test:test_support",
       "../test:video_test_common",
-      "../voice_engine:voice_engine",
     ]
   }
 }
diff --git a/media/DEPS b/media/DEPS
index 7a266a2..99e62aa 100644
--- a/media/DEPS
+++ b/media/DEPS
@@ -14,7 +14,6 @@
   "+pc",
   "+sound",
   "+system_wrappers",
-  "+voice_engine",
   "+usrsctplib",
   "+third_party/libyuv",
 ]
diff --git a/modules/audio_mixer/DEPS b/modules/audio_mixer/DEPS
index 51608ad..de2271a 100644
--- a/modules/audio_mixer/DEPS
+++ b/modules/audio_mixer/DEPS
@@ -10,5 +10,4 @@
   "+modules/rtp_rtcp",
   "+modules/utility",
   "+system_wrappers",
-  "+voice_engine",
 ]
diff --git a/modules/remote_bitrate_estimator/BUILD.gn b/modules/remote_bitrate_estimator/BUILD.gn
index 6bca26d..2fe3cc2 100644
--- a/modules/remote_bitrate_estimator/BUILD.gn
+++ b/modules/remote_bitrate_estimator/BUILD.gn
@@ -155,7 +155,6 @@
       "../../system_wrappers:field_trial_api",
       "../../test:perf_test",
       "../../test:test_support",
-      "../../voice_engine",
       "../bitrate_controller",
       "../congestion_controller",
       "../congestion_controller:delay_based_bwe",
diff --git a/modules/remote_bitrate_estimator/DEPS b/modules/remote_bitrate_estimator/DEPS
index d6a2fba..8499c25 100644
--- a/modules/remote_bitrate_estimator/DEPS
+++ b/modules/remote_bitrate_estimator/DEPS
@@ -2,9 +2,3 @@
   "+logging/rtc_event_log",
   "+system_wrappers",
 ]
-
-specific_include_rules = {
-  "nada\.h": [
-    "+voice_engine",
-  ],
-}
diff --git a/modules/remote_bitrate_estimator/test/estimators/nada.h b/modules/remote_bitrate_estimator/test/estimators/nada.h
index 590175c..f00a6d3 100644
--- a/modules/remote_bitrate_estimator/test/estimators/nada.h
+++ b/modules/remote_bitrate_estimator/test/estimators/nada.h
@@ -24,7 +24,6 @@
 #include "modules/include/module_common_types.h"
 #include "modules/remote_bitrate_estimator/test/bwe.h"
 #include "rtc_base/constructormagic.h"
-#include "voice_engine/channel.h"
 
 namespace webrtc {
 
diff --git a/pc/DEPS b/pc/DEPS
index 1992af0..24cb242 100644
--- a/pc/DEPS
+++ b/pc/DEPS
@@ -18,7 +18,6 @@
 specific_include_rules = {
   "androidtestinitializer\.cc": [
     "+base/android",  # Allowed only for Android tests.
-    "+voice_engine",
   ],
   "srtpfilter_unittest\.cc": [
     "+crypto",
diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn
index b57f48d..fa4a8f9 100644
--- a/sdk/android/BUILD.gn
+++ b/sdk/android/BUILD.gn
@@ -111,7 +111,6 @@
     "../../api/audio_codecs:builtin_audio_encoder_factory",
     "../../modules/audio_processing:audio_processing",
     "../../rtc_base:rtc_base_approved",
-    "../../voice_engine:voice_engine",
   ]
 }
 
diff --git a/sdk/android/src/jni/DEPS b/sdk/android/src/jni/DEPS
index db95db6..1cf4ba1 100644
--- a/sdk/android/src/jni/DEPS
+++ b/sdk/android/src/jni/DEPS
@@ -12,5 +12,4 @@
   "+modules/video_coding",
   "+pc",
   "+system_wrappers/include",
-  "+voice_engine/include/voe_base.h",
 ]
diff --git a/test/BUILD.gn b/test/BUILD.gn
index c058b5c..a83e8bb 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -567,7 +567,6 @@
     "layer_filtering_transport.cc",
     "layer_filtering_transport.h",
     "mock_transport.h",
-    "mock_voe_channel_proxy.h",
     "null_transport.cc",
     "null_transport.h",
     "rtp_rtcp_observer.h",
@@ -628,7 +627,6 @@
     "../system_wrappers",
     "../system_wrappers:field_trial_api",
     "../video",
-    "../voice_engine",
     "//testing/gmock",
     "//testing/gtest",
   ]
diff --git a/test/DEPS b/test/DEPS
index 1cf56a8..71d3d25 100644
--- a/test/DEPS
+++ b/test/DEPS
@@ -16,7 +16,6 @@
   "+modules/video_coding",
   "+sdk",
   "+system_wrappers",
-  "+voice_engine",
   "+third_party/libyuv",
 ]
 
diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn
index 43df618..0ccabfc 100644
--- a/test/fuzzers/BUILD.gn
+++ b/test/fuzzers/BUILD.gn
@@ -416,9 +416,9 @@
   ]
   deps = [
     "../../api:array_view",
+    "../../audio",
     "../../modules/rtp_rtcp:rtp_rtcp_format",
     "../../rtc_base:rtc_base_approved",
-    "../../voice_engine",
   ]
 }
 rtc_static_library("audio_processing_fuzzer_helper") {
diff --git a/test/fuzzers/DEPS b/test/fuzzers/DEPS
index cdbb566..222cd02 100644
--- a/test/fuzzers/DEPS
+++ b/test/fuzzers/DEPS
@@ -1,3 +1,3 @@
 include_rules = [
-  "+webrtc",
+  "+audio",
 ]
diff --git a/test/fuzzers/transport_feedback_packet_loss_tracker_fuzzer.cc b/test/fuzzers/transport_feedback_packet_loss_tracker_fuzzer.cc
index 31bc163..2168d21 100644
--- a/test/fuzzers/transport_feedback_packet_loss_tracker_fuzzer.cc
+++ b/test/fuzzers/transport_feedback_packet_loss_tracker_fuzzer.cc
@@ -11,10 +11,10 @@
 #include <algorithm>
 
 #include "api/array_view.h"
+#include "audio/transport_feedback_packet_loss_tracker.h"
 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
 #include "modules/rtp_rtcp/source/byte_io.h"
 #include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
-#include "voice_engine/transport_feedback_packet_loss_tracker.h"
 
 namespace webrtc {
 
diff --git a/video/BUILD.gn b/video/BUILD.gn
index 31ad45c..8502691 100644
--- a/video/BUILD.gn
+++ b/video/BUILD.gn
@@ -94,7 +94,6 @@
     "../rtc_base:sequenced_task_checker",
     "../rtc_base:weak_ptr",
     "../system_wrappers",
-    "../voice_engine",
   ]
 
   if (!build_with_mozilla) {
@@ -130,7 +129,6 @@
       "../test:test_support_test_artifacts",
       "../test:video_test_common",
       "../test:video_test_support",
-      "../voice_engine",
     ]
     if (!build_with_chromium && is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
diff --git a/video/DEPS b/video/DEPS
index b94455e..288ecfd 100644
--- a/video/DEPS
+++ b/video/DEPS
@@ -15,5 +15,4 @@
   "+modules/video_capture",
   "+modules/video_processing",
   "+system_wrappers",
-  "+voice_engine",
 ]
diff --git a/voice_engine/BUILD.gn b/voice_engine/BUILD.gn
deleted file mode 100644
index d0de9c6..0000000
--- a/voice_engine/BUILD.gn
+++ /dev/null
@@ -1,148 +0,0 @@
-# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
-#
-# Use of this source code is governed by a BSD-style license
-# that can be found in the LICENSE file in the root of the source
-# tree. An additional intellectual property rights grant can be found
-# in the file PATENTS.  All contributing project authors may
-# be found in the AUTHORS file in the root of the source tree.
-
-import("../webrtc.gni")
-
-visibility = [ ":*" ]
-
-rtc_static_library("voice_engine") {
-  visibility += [ "*" ]
-  sources = [
-    "channel.cc",
-    "channel.h",
-    "channel_proxy.cc",
-    "channel_proxy.h",
-    "transport_feedback_packet_loss_tracker.cc",
-    "transport_feedback_packet_loss_tracker.h",
-    "utility.cc",
-    "utility.h",
-  ]
-
-  if (is_win) {
-    cflags = [
-      # TODO(kjellander): Bug 261: fix this warning.
-      "/wd4373",  # Virtual function override.
-    ]
-  }
-
-  if (!build_with_chromium && is_clang) {
-    # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
-  }
-
-  deps = [
-    ":audio_level",
-    "..:webrtc_common",
-    "../:typedefs",
-    "../api:array_view",
-    "../api:audio_mixer_api",
-    "../api:call_api",
-    "../api:libjingle_peerconnection_api",
-    "../api:optional",
-    "../api:refcountedbase",
-    "../api:transport_api",
-    "../api/audio_codecs:audio_codecs_api",
-    "../audio/utility:audio_frame_operations",
-    "../call:rtp_interfaces",
-    "../common_audio",
-    "../logging:rtc_event_log_api",
-    "../modules:module_api",
-    "../modules/audio_coding",
-    "../modules/audio_coding:audio_format_conversion",
-    "../modules/audio_coding:audio_network_adaptor_config",
-    "../modules/audio_device",
-    "../modules/audio_processing",
-    "../modules/bitrate_controller",
-    "../modules/media_file",
-    "../modules/pacing",
-    "../modules/rtp_rtcp",
-    "../modules/rtp_rtcp:rtp_rtcp_format",
-    "../modules/utility",
-    "../rtc_base:checks",
-    "../rtc_base:rate_limiter",
-    "../rtc_base:rtc_base_approved",
-    "../rtc_base:rtc_task_queue",
-    "../system_wrappers",
-    "../system_wrappers:field_trial_api",
-    "../system_wrappers:metrics_api",
-  ]
-}
-
-rtc_static_library("audio_level") {
-  visibility += [
-    ":voice_engine",
-    "../audio:audio",
-  ]
-  sources = [
-    "audio_level.cc",
-    "audio_level.h",
-  ]
-
-  deps = [
-    "..:webrtc_common",
-    "../:typedefs",
-    "../common_audio",
-    "../modules:module_api",
-    "../rtc_base:rtc_base_approved",
-  ]
-}
-
-if (rtc_include_tests) {
-  rtc_test("voice_engine_unittests") {
-    visibility += webrtc_default_visibility
-    deps = [
-      ":voice_engine",
-      "../api/audio_codecs:builtin_audio_decoder_factory",
-      "../common_audio",
-      "../modules:module_api",
-      "../modules/audio_coding",
-      "../modules/audio_device",
-      "../modules/audio_processing",
-      "../modules/media_file",
-      "../modules/rtp_rtcp:rtp_rtcp_format",
-      "../modules/utility",
-      "../modules/video_capture:video_capture",
-      "../rtc_base:checks",
-      "../rtc_base:rtc_base_approved",
-      "../rtc_base:rtc_base_tests_utils",
-      "../system_wrappers",
-      "../test:test_common",
-      "../test:test_main",
-      "../test:video_test_common",
-      "//testing/gmock",
-      "//testing/gtest",
-    ]
-
-    if (is_android) {
-      deps += [ "//testing/android/native_test:native_test_native_code" ]
-      shard_timeout = 900
-    }
-
-    sources = [
-      "transport_feedback_packet_loss_tracker_unittest.cc",
-      "utility_unittest.cc",
-    ]
-
-    data = [
-      "../resources/utility/encapsulated_pcm16b_8khz.wav",
-      "../resources/utility/encapsulated_pcmu_8khz.wav",
-    ]
-
-    if (is_win) {
-      cflags = [
-        # TODO(kjellander): Bug 261: fix this warning.
-        "/wd4373",  # Virtual function override.
-      ]
-    }
-
-    if (!build_with_chromium && is_clang) {
-      # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
-    }
-  }
-}
diff --git a/voice_engine/DEPS b/voice_engine/DEPS
deleted file mode 100644
index c8e9a1c..0000000
--- a/voice_engine/DEPS
+++ /dev/null
@@ -1,14 +0,0 @@
-include_rules = [
-  "+audio/utility/audio_frame_operations.h",
-  "+call",
-  "+common_audio",
-  "+logging/rtc_event_log",
-  "+modules/audio_coding",
-  "+modules/audio_device",
-  "+modules/audio_processing",
-  "+modules/media_file",
-  "+modules/pacing",
-  "+modules/rtp_rtcp",
-  "+modules/utility",
-  "+system_wrappers",
-]
diff --git a/voice_engine/OWNERS b/voice_engine/OWNERS
deleted file mode 100644
index 0430ede..0000000
--- a/voice_engine/OWNERS
+++ /dev/null
@@ -1,10 +0,0 @@
-henrikg@webrtc.org
-henrika@webrtc.org
-niklas.enbom@webrtc.org
-solenberg@webrtc.org
-
-
-# These are for the common case of adding or renaming files. If you're doing
-# structural changes, please get a review from a reviewer in this file.
-per-file *.gn=*
-per-file *.gni=*