Android AppRTCMobile: Use new audio device code
This CL contains some follow-up fixes for https://webrtc-review.googlesource.com/c/src/+/60541. It removes all use of the old voiceengine implementation from AppRTCMobile. Bug: webrtc:7452 Change-Id: Iea21a4b3be1f3cbb5062831164fffb2c8051d858 Reviewed-on: https://webrtc-review.googlesource.com/63480 Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Reviewed-by: Paulina Hensman <phensman@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22530}
This commit is contained in:
committed by
Commit Bot
parent
82fad3d513
commit
08006d4133
@ -19,15 +19,15 @@ import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import org.webrtc.voiceengine.WebRtcAudioRecord;
|
||||
import org.webrtc.voiceengine.WebRtcAudioRecord.AudioSamples;
|
||||
import org.webrtc.voiceengine.WebRtcAudioRecord.WebRtcAudioRecordSamplesReadyCallback;
|
||||
import org.webrtc.audio.AudioDeviceModule;
|
||||
import org.webrtc.audio.AudioDeviceModule.AudioSamples;
|
||||
import org.webrtc.audio.AudioDeviceModule.SamplesReadyCallback;
|
||||
|
||||
/**
|
||||
* Implements the WebRtcAudioRecordSamplesReadyCallback interface and writes
|
||||
* Implements the AudioRecordSamplesReadyCallback interface and writes
|
||||
* recorded raw audio samples to an output file.
|
||||
*/
|
||||
public class RecordedAudioToFileController implements WebRtcAudioRecordSamplesReadyCallback {
|
||||
public class RecordedAudioToFileController implements SamplesReadyCallback {
|
||||
private static final String TAG = "RecordedAudioToFile";
|
||||
private static final long MAX_FILE_SIZE_IN_BYTES = 58348800L;
|
||||
|
||||
@ -52,7 +52,7 @@ public class RecordedAudioToFileController implements WebRtcAudioRecordSamplesRe
|
||||
return false;
|
||||
}
|
||||
// Register this class as receiver of recorded audio samples for storage.
|
||||
WebRtcAudioRecord.setOnAudioSamplesReady(this);
|
||||
AudioDeviceModule.setOnAudioSamplesReady(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ public class RecordedAudioToFileController implements WebRtcAudioRecordSamplesRe
|
||||
public void stop() {
|
||||
Log.d(TAG, "stop");
|
||||
// De-register this class as receiver of recorded audio samples for storage.
|
||||
WebRtcAudioRecord.setOnAudioSamplesReady(null);
|
||||
AudioDeviceModule.setOnAudioSamplesReady(null);
|
||||
synchronized (lock) {
|
||||
if (rawAudioFileOutputStream != null) {
|
||||
try {
|
||||
|
||||
@ -18,7 +18,6 @@ import android.preference.ListPreference;
|
||||
import android.preference.Preference;
|
||||
import org.webrtc.Camera2Enumerator;
|
||||
import org.webrtc.audio.AudioDeviceModule;
|
||||
import org.webrtc.voiceengine.WebRtcAudioUtils;
|
||||
|
||||
/**
|
||||
* Settings activity for AppRTC.
|
||||
|
||||
Reference in New Issue
Block a user