@@ -79,14 +79,19 @@ class PlatformTrackCollectorDelegate : public RoomDelegate {
7979class PlatformAudioIntegrationTest : public LiveKitTestBase {};
8080
8181// Publishing a platform-ADM-backed audio track should reach a remote
82- // participant exactly like a manually fed AudioSource track. No real
83- // microphone is required: the source captures silence on headless runners,
84- // but the publish/subscribe round-trip still completes.
82+ // participant exactly like a manually fed AudioSource track. Unlike AudioSource,
83+ // PlatformAudio requires a working platform Audio Device Module: constructing it
84+ // throws PlatformAudioError when no ADM is available (e.g. a headless runner with
85+ // no audio subsystem), so the test is skipped in that environment.
8586TEST_F (PlatformAudioIntegrationTest, PublishPlatformAudioTrackEndToEnd) {
8687 EXPECT_TRUE (config_.available ) << " Missing integration configuration" ;
8788
8889 std::unique_ptr<PlatformAudio> platform_audio;
89- EXPECT_NO_THROW (platform_audio = std::make_unique<PlatformAudio>());
90+ try {
91+ platform_audio = std::make_unique<PlatformAudio>();
92+ } catch (const PlatformAudioError& error) {
93+ GTEST_SKIP () << " PlatformAudio unavailable: " << error.what ();
94+ }
9095
9196 RoomOptions options;
9297 options.auto_subscribe = true ;
@@ -125,7 +130,11 @@ TEST_F(PlatformAudioIntegrationTest, UnpublishPlatformAudioTrackPropagates) {
125130 EXPECT_TRUE (config_.available ) << " Missing integration configuration" ;
126131
127132 std::unique_ptr<PlatformAudio> platform_audio;
128- EXPECT_NO_THROW (platform_audio = std::make_unique<PlatformAudio>());
133+ try {
134+ platform_audio = std::make_unique<PlatformAudio>();
135+ } catch (const PlatformAudioError& error) {
136+ GTEST_SKIP () << " PlatformAudio unavailable: " << error.what ();
137+ }
129138
130139 RoomOptions options;
131140 options.auto_subscribe = true ;
@@ -176,7 +185,11 @@ TEST_F(PlatformAudioIntegrationTest, MultipleSourcesFromOneManagerPublish) {
176185 EXPECT_TRUE (config_.available ) << " Missing integration configuration" ;
177186
178187 std::unique_ptr<PlatformAudio> platform_audio;
179- EXPECT_NO_THROW (platform_audio = std::make_unique<PlatformAudio>());
188+ try {
189+ platform_audio = std::make_unique<PlatformAudio>();
190+ } catch (const PlatformAudioError& error) {
191+ GTEST_SKIP () << " PlatformAudio unavailable: " << error.what ();
192+ }
180193
181194 RoomOptions options;
182195 options.auto_subscribe = true ;
@@ -221,14 +234,19 @@ TEST_F(PlatformAudioIntegrationTest, MultipleSourcesFromOneManagerPublish) {
221234
222235// Audio captured by the platform Audio Device Module must actually stream to a
223236// remote participant as decoded frames, not merely produce a subscribed track.
224- // PlatformAudioSource captures the real microphone (silence on headless
225- // runners), so this verifies frames *flow* end-to-end without asserting on
226- // their content.
237+ // PlatformAudioSource captures the real microphone, so this verifies frames
238+ // *flow* end-to-end without asserting on their content. PlatformAudio requires a
239+ // working platform ADM, so the test is skipped when one is unavailable (e.g. a
240+ // headless runner with no audio subsystem).
227241TEST_F (PlatformAudioIntegrationTest, PlatformAudioFramesReachRemote) {
228242 EXPECT_TRUE (config_.available ) << " Missing integration configuration" ;
229243
230244 std::unique_ptr<PlatformAudio> platform_audio;
231- EXPECT_NO_THROW (platform_audio = std::make_unique<PlatformAudio>());
245+ try {
246+ platform_audio = std::make_unique<PlatformAudio>();
247+ } catch (const PlatformAudioError& error) {
248+ GTEST_SKIP () << " PlatformAudio unavailable: " << error.what ();
249+ }
232250
233251 RoomOptions options;
234252 options.auto_subscribe = true ;
0 commit comments