Use compressed versions of in-app sounds

This commit is contained in:
Ilya Laktyushin 2021-04-01 18:08:21 +03:00
parent c9cf1ae1d1
commit 7fd4d5fe18
19 changed files with 16 additions and 10 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -108,15 +108,15 @@ enum PresentationCallTone: Equatable {
func presentationCallToneData(_ tone: PresentationCallTone) -> Data? {
switch tone {
case .ringing:
return loadToneData(name: "voip_ringback.caf")
return loadToneData(name: "voip_ringback.mp3")
case .connecting:
return loadToneData(name: "voip_connecting.mp3")
case .busy:
return loadToneData(name: "voip_busy.caf")
return loadToneData(name: "voip_busy.mp3")
case .failed:
return loadToneData(name: "voip_fail.caf")
return loadToneData(name: "voip_fail.mp3")
case .ended:
return loadToneData(name: "voip_end.caf")
return loadToneData(name: "voip_end.mp3")
case .groupJoined:
return loadToneData(name: "voip_group_joined.mp3")
case .groupLeft:

View File

@ -1544,7 +1544,7 @@ public final class VoiceChatController: ViewController {
self.bottomPanelNode.addSubnode(self.bottomCornersNode)
self.bottomPanelNode.addSubnode(self.bottomPanelBackgroundNode)
self.bottomPanelNode.addSubnode(self.audioButton)
if let mainVideoContainer = self.mainVideoContainer {
if let _ = self.mainVideoContainer {
self.bottomPanelNode.addSubnode(self.cameraButton)
self.bottomPanelNode.addSubnode(self.switchCameraButton)
}
@ -2995,7 +2995,13 @@ public final class VoiceChatController: ViewController {
let secondButtonFrame: CGRect
let thirdButtonFrame: CGRect
let forthButtonFrame: CGRect
let leftButtonFrame = CGRect(origin: CGPoint(x: sideButtonOrigin, y: floor((self.effectiveBottomAreaHeight - sideButtonSize.height - upperButtonDistance - cameraButtonSize.height) / 2.0) + upperButtonDistance + cameraButtonSize.height), size: sideButtonSize)
let leftButtonFrame: CGRect
if self.mainVideoContainer == nil {
leftButtonFrame = CGRect(origin: CGPoint(x: sideButtonOrigin, y: floor((self.effectiveBottomAreaHeight - sideButtonSize.height) / 2.0)), size: sideButtonSize)
} else {
leftButtonFrame = CGRect(origin: CGPoint(x: sideButtonOrigin, y: floor((self.effectiveBottomAreaHeight - sideButtonSize.height - upperButtonDistance - cameraButtonSize.height) / 2.0) + upperButtonDistance + cameraButtonSize.height), size: sideButtonSize)
}
let rightButtonFrame = CGRect(origin: CGPoint(x: size.width - sideButtonOrigin - sideButtonSize.width, y: floor((self.effectiveBottomAreaHeight - sideButtonSize.height) / 2.0)), size: sideButtonSize)
let smallButtons: Bool

Binary file not shown.

Binary file not shown.

View File

@ -11,7 +11,7 @@ private func loadAudioRecordingToneData() -> Data? {
AVLinearPCMIsBigEndianKey: false as NSNumber
]
guard let url = Bundle.main.url(forResource: "begin_record", withExtension: "caf") else {
guard let url = Bundle.main.url(forResource: "begin_record", withExtension: "mp3") else {
return nil
}

View File

@ -136,7 +136,7 @@ private func rendererInputProc(refCon: UnsafeMutableRawPointer, ioActionFlags: U
}
private let beginToneData: TonePlayerData? = {
guard let url = Bundle.main.url(forResource: "begin_record", withExtension: "caf") else {
guard let url = Bundle.main.url(forResource: "begin_record", withExtension: "mp3") else {
return nil
}
return loadTonePlayerData(path: url.path)

View File

@ -20,8 +20,8 @@ public final class ServiceSoundManager {
init() {
self.queue.async {
self.messageDeliverySound = loadSystemSoundFromBundle(name: "MessageSent.caf")
self.incomingMessageSound = loadSystemSoundFromBundle(name: "notification.caf")
self.messageDeliverySound = loadSystemSoundFromBundle(name: "MessageSent.mp3")
self.incomingMessageSound = loadSystemSoundFromBundle(name: "notification.mp3")
}
}