I'm facing a problem when sharing an audio file which it's format is not mp3. the file is shared but with a shorter length for example if the file is 10 seconds it only shared 5 seconds. if I used mp3 format it's shared completely, but other formats make the problem.
note: the file is shared without problem in other apps like messenger, also It shared without problem in android version 5.1
this is my code to share the audio file
String content = //my file path on device "on external storage"
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("audio/*");
Uri uri = FileProvider.getUriForFile(context, context.getString(R.string.file_provider_authority), new File(content));
share.putExtra(Intent.EXTRA_STREAM, uri);
share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(share, context.getString(R.string.share)));
Also I don't want to change the file format to mp3, I need it to be in flac format