calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 369 forks source link

Way to check if audio is playing #809

Open dennislysenko opened 9 years ago

dennislysenko commented 9 years ago

Having a way to check if audio is playing would be incredibly useful for testing audio based apps. If this is an unrealistic goal, feel free to close. If this is realistic but not something the Calabash team is willing to pursue, any pointers in the right direction would be appreciated.

jmoody commented 9 years ago

If you could figure out how to determine if audio is playing from Objective-C we would consider adding this to server.

jmoody commented 9 years ago

@dslysenko Can you recommend a way to detect if audio is playing in Objective-C?

dennislysenko commented 9 years ago

@jmoody Perhaps the AVAudioSession class would provide a good approximation? https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioSession_ClassReference/#//apple_ref/occ/instp/AVAudioSession/category

Between the category and mode properties there could be enough information to check if an app has registered an audio session. (If there is a way to read the active property which I assume is what is set by the setActive: method that might be an even better option.)

jmoody commented 9 years ago

The AV framework would have to be linked to the Calabash framework, no?

If so, we can't add this feature to the server itself. We could add it as a Calabash plug-in. https://github.com/calabash/memoryPluginCalabash

dennislysenko commented 9 years ago

That would be great as a plugin!

On Mon, Sep 21, 2015, 5:03 AM Joshua Moody notifications@github.com wrote:

The AV framework would have to be linked to the Calabash framework, no?

If so, we can't add this feature to the server itself. We could add it as a Calabash plug-in. https://github.com/calabash/memoryPluginCalabash

— Reply to this email directly or view it on GitHub https://github.com/calabash/calabash-ios/issues/809#issuecomment-141917583 .