mirror of
https://github.com/DrKLO/Telegram.git
synced 2025-03-27 00:38:50 +01:00
fixed audio recording
This commit is contained in:
parent
6e63dee546
commit
c6576ca09b
1 changed files with 5 additions and 2 deletions
|
@ -56,6 +56,8 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
|
|||
private long recordStartTime;
|
||||
private long recordDialogId;
|
||||
|
||||
private int audioBitDepth = 4;
|
||||
|
||||
private final Integer sync = 1;
|
||||
|
||||
private int lastTag = 0;
|
||||
|
@ -379,9 +381,10 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
|
|||
} else {
|
||||
audioRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
|
||||
}
|
||||
audioRecorder.setAudioSamplingRate(24000);
|
||||
audioRecorder.setAudioSamplingRate(16000);
|
||||
audioRecorder.setAudioChannels(1);
|
||||
audioRecorder.setAudioEncodingBitRate(16000);
|
||||
// formula : Bit rate = (sampling rate) × (bit depth) × (number of channels)
|
||||
audioRecorder.setAudioEncodingBitRate(16000*audioBitDepth*1);
|
||||
|
||||
try {
|
||||
audioRecorder.prepare();
|
||||
|
|
Loading…
Add table
Reference in a new issue