Skip to content

Commit

Permalink
Update Audio Encoder to AAC when sending recorded audio
Browse files Browse the repository at this point in the history
  • Loading branch information
tien-awair committed Apr 25, 2022
1 parent f56b0da commit 9fb6153
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions uikit/src/main/java/com/sendbird/uikit/AudioRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public class AudioRecorder {

public File startRecording(Context context) {
try {
File output = File.createTempFile("audio_", ".mp3", context.getFilesDir());
File output = File.createTempFile("audio_", ".m4a", context.getFilesDir());
recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setOutputFile(output.getAbsolutePath());
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
recorder.prepare();
recorder.start();
return output;
Expand Down

0 comments on commit 9fb6153

Please sign in to comment.