Skip to content

Commit

Permalink
Fix the issue of the audio recording segment repeating at the end on …
Browse files Browse the repository at this point in the history
…the Android platform.
  • Loading branch information
t871005y committed Sep 8, 2024
1 parent 3dd8f8e commit 46f520c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Plugin.Maui.Audio/AudioRecorder/AudioRecorder.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,8 @@ void WriteAudioDataToFile()
{
while (audioRecord.RecordingState == RecordState.Recording)
{
audioRecord.Read(data, 0, bufferSize);

outputStream.Write(data);
var read = audioRecord.Read(data, 0, bufferSize);
outputStream.Write(data, 0, read);
}

outputStream.Close();
Expand Down

0 comments on commit 46f520c

Please sign in to comment.