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 (#129)
  • Loading branch information
t871005y authored Sep 9, 2024
1 parent 2b53e19 commit 8afcfb9
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 8afcfb9

Please sign in to comment.