Platform audio for Unity#293
Conversation
149fad2 to
e88ff05
Compare
9bd2f8c to
0f2ee14
Compare
|
|
||
| /// <summary> | ||
| /// Sets the recording device (microphone) by index. | ||
| /// |
There was a problem hiding this comment.
Add disclaimer here as well about mobile platform no-ops
| /// platformAudio.Dispose(); | ||
| /// </code> | ||
| /// </example> | ||
| public sealed class PlatformAudio : IDisposable |
There was a problem hiding this comment.
Maybe add a Rust side function call for PlatformAudio.DeviceSelectionSupported for clients to query.
There was a problem hiding this comment.
If we do support device selection on mobile in the future, the client code does not change.
There was a problem hiding this comment.
Split between input and output device selection?
| foreach (var device in playout) | ||
| Debug.Log($" [{device.Index}] {device.Name}"); | ||
|
|
||
| if (_platformAudio.RecordingDeviceCount > 0) |
There was a problem hiding this comment.
Test with a device that has no input or output device
|
Add tests to init platform audio. |
Look at the cpp side: |
Mirror the C++ PlatformAudio test suites in the Unity Test Framework: - EditMode (pure-managed, always run): AudioProcessingOptions defaults, AudioDevice struct, PlatformAudioSource null-arg guard. - PlayMode unit (ADM-backed, no server): create source/track, custom options, enumerate + select-by-GUID, out-of-range index, start/stop recording. Skips via Assert.Ignore when no platform ADM is available. - PlayMode E2E (Category=E2E): publish/unpublish round-trip, multiple sources from one manager, and media flow verified via an InboundRtp audio stat (the batch-mode-friendly substitute for the C++ frame callback). Shared PlatformAudioTestHelper.TryCreateOrIgnore mirrors GTEST_SKIP for environments without an ADM. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Background
Integrates the Rust Platform Audio Module. The old Unity audio input and output is still supported, the platform audio is now a second path to get audio input and output.
Changes