Skip to content

Commit 8afcfb9

Browse files
authored
Fix the issue of the audio recording segment repeating at the end on the Android platform (#129)
1 parent 2b53e19 commit 8afcfb9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Plugin.Maui.Audio/AudioRecorder/AudioRecorder.android.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,8 @@ void WriteAudioDataToFile()
162162
{
163163
while (audioRecord.RecordingState == RecordState.Recording)
164164
{
165-
audioRecord.Read(data, 0, bufferSize);
166-
167-
outputStream.Write(data);
165+
var read = audioRecord.Read(data, 0, bufferSize);
166+
outputStream.Write(data, 0, read);
168167
}
169168

170169
outputStream.Close();

0 commit comments

Comments
 (0)