My problem is as follows.
I generate an audio file (.wav) from my application and share it through an intent .. but by doing it via whatsapp only 1 sec of audio is sent. When the email is sent correctly, the complete file is sent.
Any ideas that may be failing?
The file I keep in the folder "/storage/emulated/0/Download/prueba1.wav"
public void startShare() {
File f = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)+ "//prueba1.wav");
Log.d("SHARE FILE", "File: " + f);
Uri uri = Uri.parse("file://" + f.getAbsolutePath());
Intent share = new Intent(Intent.ACTION_SEND);
share.putExtra(Intent.EXTRA_STREAM, uri);
share.setType("audio/mp3");
share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
this.startActivity(Intent.createChooser(share, "Share audio File"));
}
Slds.
UPDATE: It is not a second of audio what WhatsApp sends, but approximately half the duration of the Wav. I think the problem is in the Wav format that uses synthesizeToFile, since I try to send the file generated by my application directly from WhatsApp with the same problem. On the other hand, when I converted it to MP3, I was able to send it without problems.
Thank you very much for your comments, I will continue investigating.
Slds.