Hi All I'm reading raw audio from Android device and I want to write it into a file using Okio like this:
BufferedSink sink = Okio.buffer(Okio.sink(file));
I have a callback to retrieve audio data, and then write the audio data to bufferedSink
@Override
public void onAudioData(byte[] data) {
sink.write(data);
}
But sometimes, when I listen to the audio file the last frames are missing, and all files have a length of 8182 bytes or multiples.
If I use FileOutputStream everything works well, but this is a first approach and my future purpose is to stream the audio using Okio Pipes and OkHttp. Does anyone know why this is happening?