File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
firebaseai/LiveAudioExample/ViewModels Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,10 @@ class LiveViewModel: ObservableObject {
8787 return
8888 }
8989
90+ #if targetEnvironment(simulator)
91+ logger. warning ( " Playback audio is disabled on the simulator. " )
92+ #endif
93+
9094 guard await requestRecordPermission ( ) else {
9195 logger. warning ( " The user denied us permission to record the microphone. " )
9296 return
@@ -213,7 +217,9 @@ class LiveViewModel: ObservableObject {
213217 for part in content. parts {
214218 if let part = part as? InlineDataPart {
215219 if part. mimeType. starts ( with: " audio/pcm " ) {
220+ #if !targetEnvironment(simulator)
216221 try await audioController? . playAudio ( audio: part. data)
222+ #endif
217223 } else {
218224 logger. warning ( " Received non audio inline data part: \( part. mimeType) " )
219225 }
You can’t perform that action at this time.
0 commit comments