Skip to content

Commit

Permalink
修改demo中对讲调用
Browse files Browse the repository at this point in the history
Change-Id: Ie33e916efa760049ccf979abb4dca56fe46d40c1
  • Loading branch information
SundoggyNew committed Jan 12, 2024
1 parent d53cd6a commit b4c582b
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
// }
}
}

0 comments on commit b4c582b

Please sign in to comment.