Cleanup sounds (switch to mp3, encode at lower bitrate).' (#12507)

* Reencode mp3 sounds at lower bitrate, mono.
* Encode wav sounds as mp3.
* Remove unused sound file.
* Add opus encoded sounds.
* Add a script to encode sounds.
This commit is contained in:
bgrozev 2022-11-10 10:06:40 -06:00 committed by GitHub
parent c0f0803f01
commit 99955df5c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
58 changed files with 61 additions and 9 deletions

View File

@ -2,10 +2,10 @@
* The name of the bundled sound file which will be played when new participant
* joins the conference.
*/
export const PARTICIPANT_JOINED_FILE = 'joined.wav';
export const PARTICIPANT_JOINED_FILE = 'joined.mp3';
/**
* The name of the bundled sound file which will be played when any participant
* leaves the conference.
*/
export const PARTICIPANT_LEFT_FILE = 'left.wav';
export const PARTICIPANT_LEFT_FILE = 'left.mp3';

View File

@ -4,4 +4,4 @@
*
* @type {string}
*/
export const INCOMING_MSG_SOUND_FILE = 'incomingMessage.wav';
export const INCOMING_MSG_SOUND_FILE = 'incomingMessage.mp3';

View File

@ -5,7 +5,7 @@ import React, { Component } from 'react';
import { translate } from '../../base/i18n/functions';
import Audio from '../../base/media/components/Audio';
const TEST_SOUND_PATH = 'sounds/ring.wav';
const TEST_SOUND_PATH = 'sounds/ring.mp3';
/**
* The type of the React {@code Component} props of {@link AudioOutputPreview}.

View File

@ -16,13 +16,13 @@ export const sounds = new Map([
* The name of the sound file which will be played when outgoing call is
* expired.
*/
[ OUTGOING_CALL_EXPIRED_SOUND_ID, { file: 'rejected.wav' } ],
[ OUTGOING_CALL_EXPIRED_SOUND_ID, { file: 'rejected.mp3' } ],
/**
* The name of the sound file which will be played when outgoing call is
* rejected.
*/
[ OUTGOING_CALL_REJECTED_SOUND_ID, { file: 'rejected.wav' } ],
[ OUTGOING_CALL_REJECTED_SOUND_ID, { file: 'rejected.mp3' } ],
/**
* The name of the sound file which will be played when the status of an
@ -31,7 +31,7 @@ export const sounds = new Map([
[
OUTGOING_CALL_RINGING_SOUND_ID,
{
file: 'outgoingRinging.wav',
file: 'outgoingRinging.mp3',
options: { loop: true }
}
],
@ -40,5 +40,5 @@ export const sounds = new Map([
* The name of the sound file which will be played when outgoing call is
* started.
*/
[ OUTGOING_CALL_START_SOUND_ID, { file: 'outgoingStart.wav' } ]
[ OUTGOING_CALL_START_SOUND_ID, { file: 'outgoingStart.mp3' } ]
]);

View File

@ -7,7 +7,7 @@ import logger from '../../../logger';
import AudioSettingsEntry from './AudioSettingsEntry';
import TestButton from './TestButton';
const TEST_SOUND_PATH = 'sounds/ring.wav';
const TEST_SOUND_PATH = 'sounds/ring.mp3';
/**
* The type of the React {@code Component} props of {@link SpeakerEntry}.

50
resources/encode-sound.sh Executable file
View File

@ -0,0 +1,50 @@
#!/bin/bash
usage() {
echo "Usage: $0 [--mp3] [--opus] [--stereo] <input file ...>"
exit 1
}
for arg in "$@"; do
case "$arg" in
--stereo)
STEREO=true
shift
;;
--mp3)
MP3=true
shift
;;
--opus)
OPUS=true
shift
;;
esac
done
if [ $# -lt 1 ] ;then
usage
fi
if [ "$MP3" != "true" ] ;then
if [ "$OPUS" != "true" ] ;then
echo "At least one of --mp3 or --opus is required"
usage
fi
fi
echo "STEREO=$STEREO MP3=$MP3 OPUS=$OPUS"
AC1="-ac 1"
if [ "$STEREO" = "true" ] ;then
AC1=""
fi
for i in "$@" ;do
if [ "$MP3" = "true" ] ;then
ffmpeg -i "$i" -codec:a libmp3lame -qscale:a 9 -map_metadata -1 $AC1 "${i%.*}.mp3"
fi
if [ "$OPUS" = "true" ] ;then
ffmpeg -i "$i" -c:a libopus -b:a 30k -vbr on -compression_level 10 -map_metadata -1 $AC1 "${i%.*}.opus"
fi
done

2
sounds/README.md Normal file
View File

@ -0,0 +1,2 @@
We are trying to keep these files relatively small. Use `resources/encode-sound.sh` to
encode a file in the same way (use --stereo if stereo is needed).

Binary file not shown.

BIN
sounds/asked-unmute.opus Normal file

Binary file not shown.

Binary file not shown.

BIN
sounds/e2eeOff.opus Normal file

Binary file not shown.

Binary file not shown.

BIN
sounds/e2eeOn.opus Normal file

Binary file not shown.

BIN
sounds/incomingMessage.mp3 Normal file

Binary file not shown.

BIN
sounds/incomingMessage.opus Normal file

Binary file not shown.

BIN
sounds/joined.mp3 Normal file

Binary file not shown.

BIN
sounds/joined.opus Normal file

Binary file not shown.

Binary file not shown.

BIN
sounds/knock.opus Normal file

Binary file not shown.

BIN
sounds/left.mp3 Normal file

Binary file not shown.

BIN
sounds/left.opus Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
sounds/liveStreamingOn.opus Normal file

Binary file not shown.

Binary file not shown.

BIN
sounds/noAudioSignal.opus Normal file

Binary file not shown.

Binary file not shown.

BIN
sounds/noisyAudioInput.opus Normal file

Binary file not shown.

BIN
sounds/outgoingRinging.mp3 Normal file

Binary file not shown.

BIN
sounds/outgoingRinging.opus Normal file

Binary file not shown.

BIN
sounds/outgoingStart.mp3 Normal file

Binary file not shown.

BIN
sounds/outgoingStart.opus Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
sounds/reactions-boo.opus Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
sounds/recordingOff.opus Normal file

Binary file not shown.

Binary file not shown.

BIN
sounds/recordingOn.opus Normal file

Binary file not shown.

BIN
sounds/rejected.mp3 Normal file

Binary file not shown.

BIN
sounds/rejected.opus Normal file

Binary file not shown.

BIN
sounds/ring.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
sounds/ring.opus Normal file

Binary file not shown.

Binary file not shown.

BIN
sounds/talkWhileMuted.opus Normal file

Binary file not shown.