Skip to content

Commit

Permalink
Use a smaller buffer size for AudioTrack
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Dec 9, 2023
1 parent ff3b9f0 commit d876050
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class MainActivity : AppCompatActivity() {

private fun initAudioTrack() {
val sampleRate = tts.sampleRate()
val bufLength = (sampleRate * 2.5).toInt()
val bufLength = (sampleRate * 0.1).toInt()
Log.i(TAG, "sampleRate: ${sampleRate}, buffLength: ${bufLength}")

val attr = AudioAttributes.Builder().setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
Expand Down

0 comments on commit d876050

Please sign in to comment.