record voice message as opus

pull/1539/head
Audric Ackermann 4 years ago
parent 9efb0e104d
commit 24a67a1ec3
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -129,13 +129,8 @@
},
"devDependencies": {
"@types/backbone": "^1.4.2",
"@types/bytebuffer": "^5.0.41",
"@types/blueimp-load-image": "^2.23.8",
"@types/emoji-mart": "^2.11.3",
"@types/moment": "^2.13.0",
"@types/react-mentions": "^3.3.1",
"@types/react-mic": "^12.4.1",
"@types/styled-components": "^5.1.4",
"@types/bytebuffer": "^5.0.41",
"@types/chai": "4.1.2",
"@types/chai-as-promised": "^7.1.2",
"@types/classnames": "2.2.3",
@ -143,6 +138,7 @@
"@types/config": "0.0.34",
"@types/dompurify": "^2.0.0",
"@types/electron-is-dev": "^1.1.1",
"@types/emoji-mart": "^2.11.3",
"@types/filesize": "3.6.0",
"@types/fs-extra": "5.0.5",
"@types/jquery": "3.3.29",
@ -151,12 +147,15 @@
"@types/lodash": "4.14.106",
"@types/mkdirp": "0.5.2",
"@types/mocha": "5.0.0",
"@types/moment": "^2.13.0",
"@types/node-fetch": "^2.5.7",
"@types/pify": "3.0.2",
"@types/qs": "6.5.1",
"@types/rc-slider": "^8.6.5",
"@types/react": "16.8.5",
"@types/react-dom": "16.8.2",
"@types/react-mentions": "^3.3.1",
"@types/react-mic": "^12.4.1",
"@types/react-portal": "^4.0.2",
"@types/react-redux": "7.1.9",
"@types/react-virtualized": "9.18.12",
@ -164,6 +163,7 @@
"@types/rimraf": "2.0.2",
"@types/semver": "5.5.0",
"@types/sinon": "9.0.4",
"@types/styled-components": "^5.1.4",
"@types/uuid": "3.4.4",
"arraybuffer-loader": "1.0.3",
"asar": "0.14.0",

@ -929,7 +929,7 @@ export class SessionCompositionBox extends React.Component<Props, State> {
const audioAttachment: Attachment = {
data: fileBuffer,
flags: SignalService.AttachmentPointer.Flags.VOICE_MESSAGE,
contentType: MIME.AUDIO_MP3,
contentType: MIME.AUDIO_OPUS,
size: audioBlob.size,
};

@ -473,7 +473,9 @@ class SessionRecordingInner extends React.Component<Props, State> {
}
// Start recording the stream
const media = new window.MediaRecorder(stream, { mimeType: 'audio/webm' });
const media = new window.MediaRecorder(stream, {
mimeType: 'audio/webm;codecs=opus',
});
media.ondataavailable = (mediaBlob: any) => {
this.setState({ mediaBlob }, async () => {
// Generate PCM waveform for playback

@ -23,6 +23,7 @@ import {
import autoBind from 'auto-bind';
import { saveMessage } from '../../ts/data/data';
import { ConversationModel } from './conversation';
import { getSuggestedFilenameSending } from '../types/Attachment';
export class MessageModel extends Backbone.Model<MessageAttributes> {
public propsForTimerNotification: any;
public propsForGroupNotification: any;
@ -802,7 +803,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
const filenameOverridenAttachments = finalAttachments.map(
(attachment: any) => ({
...attachment,
fileName: window.Signal.Types.Attachment.getSuggestedFilenameSending({
fileName: getSuggestedFilenameSending({
attachment,
timestamp: Date.now(),
}),

@ -5,6 +5,7 @@ export const APPLICATION_JSON = 'application/json' as MIMEType;
export const AUDIO_AAC = 'audio/aac' as MIMEType;
export const AUDIO_WEBM = 'audio/webm' as MIMEType;
export const AUDIO_MP3 = 'audio/mp3' as MIMEType;
export const AUDIO_OPUS = 'audio/ogg' as MIMEType;
export const IMAGE_GIF = 'image/gif' as MIMEType;
export const IMAGE_JPEG = 'image/jpeg' as MIMEType;
export const IMAGE_BMP = 'image/bmp' as MIMEType;

Loading…
Cancel
Save