17 lines
579 B
Swift
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) {}
|
|
}
|