Skip to content

Commit

Permalink
Fix AVFoundation import
Browse files Browse the repository at this point in the history
  • Loading branch information
Ihor Makhnyk committed Nov 13, 2023
1 parent dc2f24e commit f34bacd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/OpenAI/Public/Models/AudioSpeechResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
//

import Foundation
#if canImport(AVFoundation)
import AVFoundation
#endif

public struct AudioSpeechResult {

Expand All @@ -33,6 +35,7 @@ public struct AudioSpeechResult {
try data.write(to: fileURL)
}

#if canImport(AVFoundation)
/// Gets an `AVAudioPlayer` instance configured with the audio data.
///
/// - Returns: An `AVAudioPlayer` instance or nil if there is no audio data or if there is issue initializing an `AVAudioPlayer`.
Expand All @@ -51,5 +54,5 @@ public struct AudioSpeechResult {
return nil
}
}

#endif
}

0 comments on commit f34bacd

Please sign in to comment.