From b4c582bca594892c02363feafa6fb49aa5493d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?whalensun=28=E5=AD=99=E4=BC=9F=29?= <532125505@qq.com> Date: Fri, 12 Jan 2024 10:23:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9demo=E4=B8=AD=E5=AF=B9?= =?UTF-8?q?=E8=AE=B2=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie33e916efa760049ccf979abb4dca56fe46d40c1 --- .../video/preview/VideoPreviewActivity.kt | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sdkdemo/src/main/java/com/tencent/iot/explorer/link/demo/video/preview/VideoPreviewActivity.kt b/sdkdemo/src/main/java/com/tencent/iot/explorer/link/demo/video/preview/VideoPreviewActivity.kt index b9292922f..5f738d74e 100644 --- a/sdkdemo/src/main/java/com/tencent/iot/explorer/link/demo/video/preview/VideoPreviewActivity.kt +++ b/sdkdemo/src/main/java/com/tencent/iot/explorer/link/demo/video/preview/VideoPreviewActivity.kt @@ -140,11 +140,11 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface presenter.getEventsData(Date()) tv_event_status.visibility = View.VISIBLE tv_event_status.setText(R.string.loading) -// audioRecordUtil = AudioRecordUtil(this, "${it.productId}/${presenter.getDeviceName()}", 16000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT) + audioRecordUtil = AudioRecordUtil(this, "${it.productId}/${presenter.getDeviceName()}", 16000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT) // //变调可以传入pitch参数 // audioRecordUtil = AudioRecordUtil(this, "${it.productId}/${presenter.getDeviceName()}", 16000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, -6) // 变调可以传入pitch参数 - audioRecordUtil = AudioRecordUtil(this, "${it.productId}/${presenter.getDeviceName()}", 16000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, 0, this) +// audioRecordUtil = AudioRecordUtil(this, "${it.productId}/${presenter.getDeviceName()}", 16000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, 0, this) audioRecordUtil.recordSpeakFlv(true) } @@ -445,7 +445,7 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface layout_video_preview?.addView(v_preview, 0) player = IjkMediaPlayer() - player._setApmStatus(true) +// player._setApmStatus(true) player?.let { val url = urlPrefix + suffix it.reset() @@ -593,7 +593,7 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface CommonUtils.refreshVideoList(this@VideoPreviewActivity, filePath) } - player?._setApmStatus(false); +// player?._setApmStatus(false); player?.release() countDownLatchs.clear() @@ -737,14 +737,14 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface } override fun onReadPlayerPcmByte(): ByteArray? { - val data = ByteArray(10240) - val len = player._getPcmData(data) - return if (len > 0) { - val playerBytes = ByteArray(len) - System.arraycopy(data, 0, playerBytes, 0, len); - playerBytes - } else { - null - } +// val data = ByteArray(10240) +// val len = player._getPcmData(data) +// return if (len > 0) { +// val playerBytes = ByteArray(len) +// System.arraycopy(data, 0, playerBytes, 0, len); +// playerBytes +// } else { + return null +// } } } \ No newline at end of file