Conversation
# Conflicts: # Packages/AudioConductor/CHANGELOG.md # Packages/AudioConductor/package.json
There was a problem hiding this comment.
Pull request overview
This PR releases v2.4.0 of the AudioConductor Unity package by introducing a CueSheet-level referenceSampleRate to keep sample-indexed playback positions stable across platforms/resampling, and by improving pause/resume behavior—especially for WebGL focus/visibility changes and for immediate Pause-after-Play timing.
Changes:
- Add
CueSheet.referenceSampleRateand runtime sample-index scaling inAudioClipPlayer.Setup(...). - Implement WebGL auto pause/resume on tab visibility/focus changes via a
.jslibbridge and runtime broadcaster. - Extend editor UI, migration flow, validation/build warnings, tests, and docs to support/communicate the new setting.
Reviewed changes
Copilot reviewed 28 out of 39 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Packages/AudioConductor/Tests/Editor/Core/Tools/CueSheetEditor/Models/CueSheetParameterPaneModelTests.cs | Adds tests for applying referenceSampleRate from clip frequencies + undo/redo. |
| Packages/AudioConductor/Tests/Editor/Core/AudioClipPlayerWebGLTests.cs.meta | Unity meta for new WebGL-focused test file. |
| Packages/AudioConductor/Tests/Editor/Core/AudioClipPlayerWebGLTests.cs | Adds WebGL-only tests for system pause/resume behavior. |
| Packages/AudioConductor/Tests/Editor/Core/AudioClipPlayerTests.cs | Adds tests for Pause/Resume race window and referenceSampleRate sample scaling. |
| Packages/AudioConductor/Runtime/Plugins/WebGL/AudioConductorWebGL.jslib.meta | Unity meta for new WebGL JS plugin. |
| Packages/AudioConductor/Runtime/Plugins/WebGL/AudioConductorWebGL.jslib | Adds Page Visibility API hooks + query for document.hidden. |
| Packages/AudioConductor/Runtime/Plugins/WebGL.meta | Unity meta for new Plugins/WebGL folder. |
| Packages/AudioConductor/Runtime/Plugins.meta | Unity meta for new Plugins folder. |
| Packages/AudioConductor/Runtime/Core/Models/CueSheet.cs | Introduces referenceSampleRate field (0 = unset). |
| Packages/AudioConductor/Runtime/Core/ConductorBehaviour.WebGL.cs.meta | Unity meta for WebGL-only ConductorBehaviour partial. |
| Packages/AudioConductor/Runtime/Core/ConductorBehaviour.WebGL.cs | Adds WebGL focus/visibility pause notifications to Conductor. |
| Packages/AudioConductor/Runtime/Core/ConductorBehaviour.cs | Makes ConductorBehaviour partial to allow platform-specific parts. |
| Packages/AudioConductor/Runtime/Core/Conductor.WebGL.cs.meta | Unity meta for WebGL-only Conductor partial. |
| Packages/AudioConductor/Runtime/Core/Conductor.WebGL.cs | Adds Conductor handler that forwards system pause/resume to players. |
| Packages/AudioConductor/Runtime/Core/Conductor.Playback.cs | Passes cueSheet.referenceSampleRate into AudioClipPlayer.Setup(...). |
| Packages/AudioConductor/Runtime/Core/AudioConductorWebGLBroadcaster.cs.meta | Unity meta for WebGL visibility broadcaster. |
| Packages/AudioConductor/Runtime/Core/AudioConductorWebGLBroadcaster.cs | Manages single JS listener and forwards events to all ConductorBehaviours. |
| Packages/AudioConductor/Runtime/Core/AudioClipPlayer.WebGL.cs.meta | Unity meta for WebGL-only AudioClipPlayer partial. |
| Packages/AudioConductor/Runtime/Core/AudioClipPlayer.WebGL.cs | Implements system pause/resume behavior for WebGL. |
| Packages/AudioConductor/Runtime/Core/AudioClipPlayer.cs | Adds sample conversion via referenceSampleRate, fixes Pause/Resume edge case, and updates state handling for WebGL system pause. |
| Packages/AudioConductor/package.json | Bumps package version to 2.4.0. |
| Packages/AudioConductor/Editor/PackageResources/Uxml/CueSheetParameterPane.uxml | Adds UI fields/help/apply button for Reference Sample Rate section. |
| Packages/AudioConductor/Editor/Localization/JapaneseTranslations.cs | Adds JP strings for reference sample rate UI + migration dialog. |
| Packages/AudioConductor/Editor/Localization/EnglishTranslations.cs | Adds EN strings for reference sample rate UI + migration dialog. |
| Packages/AudioConductor/Editor/Core/Tools/Validation/Rules/ReferenceSampleRateUnsetRule.cs.meta | Unity meta for new validation rule. |
| Packages/AudioConductor/Editor/Core/Tools/Validation/Rules/ReferenceSampleRateUnsetRule.cs | Adds warning when referenceSampleRate is unset but clips exist. |
| Packages/AudioConductor/Editor/Core/Tools/Shared/ReferenceSampleRateBuildPreprocessor.cs.meta | Unity meta for new build preprocessor. |
| Packages/AudioConductor/Editor/Core/Tools/Shared/ReferenceSampleRateBuildPreprocessor.cs | Logs pre-build warnings when CueSheets have unset referenceSampleRate. |
| Packages/AudioConductor/Editor/Core/Tools/Shared/CueSheetAssetImportChecker.cs | Adds startup migration dialog to populate referenceSampleRate where safe. |
| Packages/AudioConductor/Editor/Core/Tools/CueSheetEditor/Views/CueSheetParameterPaneView.cs | Wires up read-only field, warning, and Apply button in the parameter pane. |
| Packages/AudioConductor/Editor/Core/Tools/CueSheetEditor/Presenters/CueSheetParameterPanePresenter.cs | Binds reference sample rate display + Apply button action to the model. |
| Packages/AudioConductor/Editor/Core/Tools/CueSheetEditor/Models/ObservableCueSheet.cs | Adds observable for referenceSampleRate. |
| Packages/AudioConductor/Editor/Core/Tools/CueSheetEditor/Models/Interfaces/ICueSheetParameterPaneModel.cs | Extends interface with referenceSampleRate observables and Apply action. |
| Packages/AudioConductor/Editor/Core/Tools/CueSheetEditor/Models/CueSheetParameterPaneModel.cs | Implements apply-from-clips behavior with undo/redo + save. |
| Packages/AudioConductor/CHANGELOG.md | Adds v2.4.0 changelog entry describing new feature and fixes. |
| docs/README.md | Documents reference sample rate behavior, migration dialog, and UI. |
| docs/README_JA.md | JP documentation updates for reference sample rate behavior and UI. |
Files not reviewed (9)
- Packages/AudioConductor/Editor/Core/Tools/Shared/ReferenceSampleRateBuildPreprocessor.cs.meta: Language not supported
- Packages/AudioConductor/Editor/Core/Tools/Validation/Rules/ReferenceSampleRateUnsetRule.cs.meta: Language not supported
- Packages/AudioConductor/Runtime/Core/AudioClipPlayer.WebGL.cs.meta: Language not supported
- Packages/AudioConductor/Runtime/Core/AudioConductorWebGLBroadcaster.cs.meta: Language not supported
- Packages/AudioConductor/Runtime/Core/Conductor.WebGL.cs.meta: Language not supported
- Packages/AudioConductor/Runtime/Core/ConductorBehaviour.WebGL.cs.meta: Language not supported
- Packages/AudioConductor/Runtime/Plugins.meta: Language not supported
- Packages/AudioConductor/Runtime/Plugins/WebGL.meta: Language not supported
- Packages/AudioConductor/Runtime/Plugins/WebGL/AudioConductorWebGL.jslib.meta: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+122
to
+127
| var convertedStart = ConvertSample(startSample, referenceSampleRate, _frequency); | ||
| var convertedLoopStart = ConvertSample(loopStartSample, referenceSampleRate, _frequency); | ||
| var convertedEnd = ConvertSample(endSample, referenceSampleRate, _frequency); | ||
|
|
||
| _sources[0].TimeSamples = convertedStart; | ||
|
|
hkmt-mmy
commented
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
referenceSampleRateto CueSheet: sample positions are automatically scaled at runtime when the clip's actual decoding frequency differs from the authored rate, preventing playback drift on platforms that resample audio (e.g. when Audio Import Settings do not use Preserve Sample Rate)