Manually encode voice messages to AAC with ADTS headers

Should resolve issues with platforms that don't support AMR (!).

Fixes #4640
Fixes #4652
Fixes #4647
// FREEBIE
This commit is contained in:
Moxie Marlinspike
2015-11-22 10:44:44 -08:00
parent a0beb7f0e0
commit fc5777e904
7 changed files with 309 additions and 161 deletions

View File

@@ -25,6 +25,8 @@ import android.support.annotation.Nullable;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.attachments.Attachment;
import org.thoughtcrime.securesms.attachments.UriAttachment;
import org.thoughtcrime.securesms.database.AttachmentDatabase;
import org.thoughtcrime.securesms.util.ResUtil;
import java.io.IOException;
@@ -38,6 +40,10 @@ public class AudioSlide extends Slide {
super(context, constructAttachmentFromUri(context, uri, ContentType.AUDIO_UNSPECIFIED, dataSize));
}
public AudioSlide(Context context, Uri uri, long dataSize, String contentType) {
super(context, new UriAttachment(uri, contentType, AttachmentDatabase.TRANSFER_PROGRESS_STARTED, dataSize));
}
public AudioSlide(Context context, Attachment attachment) {
super(context, attachment);
}