From 18c057c0ed747dbefc2d72af6eb41c1d6d18ac2c Mon Sep 17 00:00:00 2001
From: gxz <guoxianzhe@agora.io>
Date: Mon, 23 Oct 2023 15:55:24 +0800
Subject: [PATCH] feat: add startProcessAudioBuffer stopProcessAudioBuffer

---
 package.json                    |  2 +-
 src/index.ts                    | 28 ++++++++++++++++++++++++++--
 src/tracks/local-audio-track.ts |  8 ++++++++
 3 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/package.json b/package.json
index 92972ad..951c5fb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@agoraio-extensions/agora-rtc-sdk-ng-fake",
-  "version": "1.0.5",
+  "version": "1.0.6",
   "private": true,
   "description": "Fake Agora Web RTC for testing",
   "repository": {
diff --git a/src/index.ts b/src/index.ts
index ea44f4d..5d933c6 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -14,6 +14,8 @@ export * from "./eventemitter";
 export * from "./client";
 export * from "./version";
 
+export const FAKE_VIDEOINPUT_DEVICE_ID = "1";
+
 const FakeAgoraRTC = createFakeAgoraRTC({
   setAppType(): void {
     //
@@ -29,11 +31,33 @@ const FakeAgoraRTC = createFakeAgoraRTC({
   },
   getCameras(): Promise<MediaDeviceInfo[]> {
     //todo
-    return Promise.resolve([]);
+    return Promise.resolve([
+      {
+        kind: "videoinput",
+        deviceId: "1",
+        label: "1",
+      },
+    ] as MediaDeviceInfo[]);
   },
   getDevices(): Promise<MediaDeviceInfo[]> {
     //todo
-    return Promise.resolve([]);
+    return Promise.resolve([
+      {
+        kind: "videoinput",
+        deviceId: FAKE_VIDEOINPUT_DEVICE_ID,
+        label: "1",
+      },
+      {
+        kind: "audiooutput",
+        deviceId: "2",
+        label: "2",
+      },
+      {
+        kind: "audioinput",
+        deviceId: "3",
+        label: "3",
+      },
+    ] as MediaDeviceInfo[]);
   },
   createMicrophoneAudioTrack: async () => FakeMicrophoneAudioTrack.create(),
   createCameraVideoTrack: async () => FakeCameraVideoTrack.create(),
diff --git a/src/tracks/local-audio-track.ts b/src/tracks/local-audio-track.ts
index c2be965..d505209 100644
--- a/src/tracks/local-audio-track.ts
+++ b/src/tracks/local-audio-track.ts
@@ -124,6 +124,14 @@ export class FakeLocalAudioTrack extends FakeLocalTrack {
     console.log("[FakeLocalAudioTrack]: setPlaybackDevice", deviceId);
   }
 
+  public startProcessAudioBuffer(): void {
+    //
+  }
+
+  public stopProcessAudioBuffer(): void {
+    //
+  }
+
   private _audioEl?: HTMLAudioElement;
   private _volume: number;
 }