mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
27 lines
604 B
Swift
27 lines
604 B
Swift
//
|
|
// AudioManager.swift
|
|
// QuickDrop
|
|
//
|
|
// Created by Leon Böttger on 01.03.25.
|
|
//
|
|
|
|
import AVFoundation
|
|
|
|
class AudioManager {
|
|
static var audioPlayer: AVAudioPlayer?
|
|
|
|
static func playSound() {
|
|
guard let soundURL = Bundle.main.url(forResource: "timeIsNow", withExtension: "mp3") else {
|
|
log("Sound file not found")
|
|
return
|
|
}
|
|
|
|
do {
|
|
audioPlayer = try AVAudioPlayer(contentsOf: soundURL)
|
|
audioPlayer?.play()
|
|
} catch {
|
|
log("Error playing sound: \(error.localizedDescription)")
|
|
}
|
|
}
|
|
}
|