Mulberry/App/Audio/FFSource.swift
2026-10-27 19:30:49 -05:00

17 lines
579 B
Swift

import AVFoundation
/// Decoder for formats Apple doesn't handle (Ogg Vorbis/Opus, WMA, APE, WavPack, Musepack, DSD, trackers…).
/// Backed by FFmpeg when the build links it (MULBERRY_FFMPEG); otherwise nothing opens.
final class FFSource: AudioSource {
static func open(_ url: URL) -> FFSource? {
#if MULBERRY_FFMPEG
return FFSource(url: url)
#else
return nil
#endif
}
var frames: AVAudioFramePosition { 0 }
func read(into buffer: AVAudioPCMBuffer) -> Bool { false }
func seek(to frame: AVAudioFramePosition) {}
}