| Commit-Queue | +1 |
NSString* category;Abhijeet Kandalkar```suggestion
AVAudioSessionCategory category;
```
Done
options = 0;Abhijeet KandalkarThis is a larger change that's not explained in the commit message; why shouldn't the other options be used on tvOS? Does it work if you don't touch the existing assignment?
I have updated commit message. It works but gives an error on console for Bluetooth related options as below :
```
Failed to set audio session category with error: The operation couldn’t be completed. (OSStatus error -50.).
```
CHECK([currentRoute.outputs count] > 0) << "No audio output route found";Abhijeet KandalkarThis wasn't in the previous patch sets; any particular reason for introducing this now? My advice is to make this CL as small and self-contained as possible, and introduce new `CHECK`s separately to avoid mixing changes and discussions.
Acknowledged
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
LGTM, with the caveat that I am not very familiar with tvOS. These changes still look sensible to me.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[tvos] Use only supported AVAudioSession options on tvOS
This change ensures that only valid audio session categories and options
are used for tvOS, preventing runtime and compile-time errors, and
improving platform reliability and correctness.
- Fixes audio unit initialization failure on tvOS by ensuring
AVAudioSessionCategoryPlayback is used. tvOS does not support
AVAudioSessionCategoryPlayAndRecord or any recording functionality.
This change ensures AVAudioSessionCategoryPlayAndRecord is only used
on iOS.
- Avoids setting unsupported AVAudioSessionCategoryOptions on tvOS:
1. AVAudioSessionCategoryOptionDefaultToSpeaker is not available on
tvOS and will cause a compile-time error if used.
2. AVAudioSessionCategoryOptionAllowBluetooth and
AVAudioSessionCategoryOptionAllowBluetoothA2DP are not supported
on tvOS. Attempting to use them results in a runtime error
(OSStatus -50) because tvOS does not support Bluetooth audio
output.
3. AVAudioSessionCategoryOptionMixWithOthers is not meaningful on
tvOS, since only one app can play audio at a time; there is no
background audio mixing. The only valid and supported options
value on tvOS is 0.
- Clarifies output port override logic for tvOS:
- tvOS hardware only supports a single output route (HDMIOutput),
which is always the default and cannot be overridden
programmatically.The overrideOutputAudioPort API and related options
are not applicable on tvOS.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |