mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2024-12-14 06:19:27 +01:00
Increase voice quality
This commit is contained in:
parent
e5fa25c27a
commit
b9084db81c
@ -521,7 +521,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
private ArrayList<ByteBuffer> recordBuffers = new ArrayList<>();
|
||||
private ByteBuffer fileBuffer;
|
||||
public int recordBufferSize = 1280;
|
||||
public int sampleRate = 16000;
|
||||
public int sampleRate = 48000;
|
||||
private int sendAfterDone;
|
||||
private boolean sendAfterDoneNotify;
|
||||
private int sendAfterDoneScheduleDate;
|
||||
@ -817,7 +817,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
|
||||
recordQueue.postRunnable(() -> {
|
||||
try {
|
||||
sampleRate = 16000;
|
||||
sampleRate = 48000;
|
||||
int minBuferSize = AudioRecord.getMinBufferSize(sampleRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT);
|
||||
if (minBuferSize <= 0) {
|
||||
minBuferSize = 1280;
|
||||
@ -3075,7 +3075,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
recordingAudioFile = new File(FileLoader.getDirectory(FileLoader.MEDIA_DIR_CACHE), FileLoader.getAttachFileName(recordingAudio));
|
||||
|
||||
try {
|
||||
if (startRecord(recordingAudioFile.getAbsolutePath(), 16000) == 0) {
|
||||
if (startRecord(recordingAudioFile.getAbsolutePath(), 48000) == 0) {
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
recordStartRunnable = null;
|
||||
NotificationCenter.getInstance(currentAccount).postNotificationName(NotificationCenter.recordStartError, guid);
|
||||
|
Loading…
Reference in New Issue
Block a user