diff --git a/audio/call-in.m4a b/audio/call-in.m4a new file mode 100644 index 00000000..71ca0f45 Binary files /dev/null and b/audio/call-in.m4a differ diff --git a/audio/call-in.mp3 b/audio/call-in.mp3 deleted file mode 100644 index b42cbe48..00000000 Binary files a/audio/call-in.mp3 and /dev/null differ diff --git a/audio/call-out.m4a b/audio/call-out.m4a new file mode 100644 index 00000000..089050fb Binary files /dev/null and b/audio/call-out.m4a differ diff --git a/audio/msg.m4a b/audio/msg.m4a new file mode 100644 index 00000000..372143dc Binary files /dev/null and b/audio/msg.m4a differ diff --git a/audio/msg.mp3 b/audio/msg.mp3 deleted file mode 100644 index bf53313a..00000000 Binary files a/audio/msg.mp3 and /dev/null differ diff --git a/package.json b/package.json index 874505ce..238d0803 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "umd/index.dev.js.map", "umd/tinode.prod.js", "umd/tinode.dev.js", - "audio/*.mp3", + "audio/*.m4a", "css/base.css", "css/base.min.css", "img/*.png", diff --git a/src/views/incoming-call-view.jsx b/src/views/incoming-call-view.jsx index fd5e7744..b629826c 100644 --- a/src/views/incoming-call-view.jsx +++ b/src/views/incoming-call-view.jsx @@ -12,7 +12,7 @@ import { CALL_STATE_INCOMING_RECEIVED } from '../constants.js'; import { makeImageUrl } from '../lib/blob-helpers.js'; import { clipStr } from '../lib/utils.js' -const RING_SOUND = new Audio('audio/call-in.mp3'); +const RING_SOUND = new Audio('audio/call-in.m4a'); export default class IncomingCallView extends React.Component { constructor(props) { diff --git a/src/views/tinode-web.jsx b/src/views/tinode-web.jsx index 06a2c622..6ea7fa89 100644 --- a/src/views/tinode-web.jsx +++ b/src/views/tinode-web.jsx @@ -31,7 +31,7 @@ import { secondsToTime } from '../lib/strformat.js' import { updateFavicon } from '../lib/utils.js'; // Sound to play on message received. -const POP_SOUND = new Audio('audio/msg.mp3'); +const POP_SOUND = new Audio('audio/msg.m4a'); const messages = defineMessages({ reconnect_countdown: { diff --git a/src/widgets/call-panel.jsx b/src/widgets/call-panel.jsx index 2e9e6b21..543a7a93 100644 --- a/src/widgets/call-panel.jsx +++ b/src/widgets/call-panel.jsx @@ -9,6 +9,9 @@ import { CALL_STATE_OUTGOING_INITATED, CALL_STATE_IN_PROGRESS } from '../constan import { clipStr } from '../lib/utils.js' +const RING_SOUND = new Audio('audio/call-out.m4a'); +RING_SOUND.loop = true; + const messages = defineMessages({ already_in_call: { id: 'already_in_call', @@ -133,6 +136,9 @@ class CallPanel extends React.PureComponent { .then(stream => { this.setState({localStream: stream}); this.localRef.current.srcObject = stream; + + RING_SOUND.play(); + // Send call invitation. this.props.onInvite(this.props.topic, this.props.seq, this.props.callState); }) @@ -140,6 +146,9 @@ class CallPanel extends React.PureComponent { } stop() { + RING_SOUND.stop(); + RING_SOUND.currentTime = 0; + this.stopTracks(this.localRef.current); this.stopTracks(this.remoteRef.current); if (this.state.pc) {