Converts wav files to ogg
This commit is contained in:
parent
7b039fa526
commit
8761bb8dae
7 changed files with 30 additions and 13 deletions
BIN
sounds/pop.ogg
Normal file
BIN
sounds/pop.ogg
Normal file
Binary file not shown.
BIN
sounds/pop.wav
BIN
sounds/pop.wav
Binary file not shown.
BIN
sounds/whoosh.ogg
Normal file
BIN
sounds/whoosh.ogg
Normal file
Binary file not shown.
Binary file not shown.
|
@ -618,7 +618,9 @@ function sendMultiMediaMessage(
|
||||||
dispatch(incrementSendCounter(conversationId));
|
dispatch(incrementSendCounter(conversationId));
|
||||||
dispatch(setComposerDisabledState(conversationId, false));
|
dispatch(setComposerDisabledState(conversationId, false));
|
||||||
|
|
||||||
drop(new Sound({ soundType: SoundType.Whoosh }).play());
|
if (state.items.audioMessage) {
|
||||||
|
drop(new Sound({ soundType: SoundType.Whoosh }).play());
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -160,6 +160,7 @@ import {
|
||||||
} from './composer';
|
} from './composer';
|
||||||
import { ReceiptType } from '../../types/Receipt';
|
import { ReceiptType } from '../../types/Receipt';
|
||||||
import { sortByMessageOrder } from '../../util/maybeForwardMessages';
|
import { sortByMessageOrder } from '../../util/maybeForwardMessages';
|
||||||
|
import { Sound, SoundType } from '../../util/Sound';
|
||||||
|
|
||||||
// State
|
// State
|
||||||
|
|
||||||
|
@ -2769,16 +2770,30 @@ function messagesAdded({
|
||||||
isJustSent: boolean;
|
isJustSent: boolean;
|
||||||
isNewMessage: boolean;
|
isNewMessage: boolean;
|
||||||
messages: ReadonlyArray<MessageAttributesType>;
|
messages: ReadonlyArray<MessageAttributesType>;
|
||||||
}): MessagesAddedActionType {
|
}): ThunkAction<void, RootStateType, unknown, MessagesAddedActionType> {
|
||||||
return {
|
return (dispatch, getState) => {
|
||||||
type: 'MESSAGES_ADDED',
|
const state = getState();
|
||||||
payload: {
|
if (
|
||||||
conversationId,
|
isNewMessage &&
|
||||||
isActive,
|
state.items.audioMessage &&
|
||||||
isJustSent,
|
conversationId === state.conversations.selectedConversationId &&
|
||||||
isNewMessage,
|
isActive &&
|
||||||
messages,
|
!isJustSent &&
|
||||||
},
|
messages.some(isIncoming)
|
||||||
|
) {
|
||||||
|
drop(new Sound({ soundType: SoundType.Pop }).play());
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatch({
|
||||||
|
type: 'MESSAGES_ADDED',
|
||||||
|
payload: {
|
||||||
|
conversationId,
|
||||||
|
isActive,
|
||||||
|
isJustSent,
|
||||||
|
isNewMessage,
|
||||||
|
messages,
|
||||||
|
},
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ export class Sound {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soundStyle === SoundType.Pop) {
|
if (soundStyle === SoundType.Pop) {
|
||||||
return 'sounds/pop.wav';
|
return 'sounds/pop.ogg';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soundStyle === SoundType.TriTone) {
|
if (soundStyle === SoundType.TriTone) {
|
||||||
|
@ -132,7 +132,7 @@ export class Sound {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soundStyle === SoundType.Whoosh) {
|
if (soundStyle === SoundType.Whoosh) {
|
||||||
return 'sounds/whoosh.wav';
|
return 'sounds/whoosh.ogg';
|
||||||
}
|
}
|
||||||
|
|
||||||
throw missingCaseError(soundStyle);
|
throw missingCaseError(soundStyle);
|
||||||
|
|
Loading…
Reference in a new issue