-
Notifications
You must be signed in to change notification settings - Fork 0
feat(player): play real audio section loops #1062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
seonghobae
merged 7 commits into
feat/rehearsal-player-first-section-loop
from
codex/real-audio-loop
Aug 30, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2803109
feat(player): play real audio section loops
seonghobae c911b41
fix(player): harden cross-platform audio loop boundaries
seonghobae 5187e03
fix(player): cap long loop boundary timers
seonghobae 6a9c576
test(player): reproduce unusable audio authority start
seonghobae 2ff2615
fix(player): require playable media authority
seonghobae d53758b
test(player): use real media authority in loop tests
seonghobae 9491543
fix(player): share playable audio authority
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
68 changes: 68 additions & 0 deletions
68
apps/desktop/src/features/workspace/RehearsalPlayer.audioAuthority.test.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { render, screen } from "@testing-library/react"; | ||
| import { createDemoRehearsalSong } from "@bandscope/shared-types"; | ||
| import { afterEach, describe, expect, it, vi } from "vitest"; | ||
| import { RehearsalPlayer } from "./RehearsalPlayer"; | ||
|
|
||
| const originalTauriInternals = Object.getOwnPropertyDescriptor( | ||
| window, | ||
| "__TAURI_INTERNALS__", | ||
| ); | ||
|
|
||
| describe("RehearsalPlayer audio authority", () => { | ||
| afterEach(() => { | ||
| vi.restoreAllMocks(); | ||
| if (originalTauriInternals) { | ||
| Object.defineProperty(window, "__TAURI_INTERNALS__", originalTauriInternals); | ||
| } else { | ||
| delete (window as Window & { __TAURI_INTERNALS__?: unknown }) | ||
| .__TAURI_INTERNALS__; | ||
| } | ||
| }); | ||
|
|
||
| it("refuses to start when local-audio metadata has no playable asset URL", () => { | ||
| const song = createDemoRehearsalSong(); | ||
|
|
||
| render( | ||
| <RehearsalPlayer | ||
| song={song} | ||
| hasLocalAudio={true} | ||
| audioSourcePath="browser://selected-audio" | ||
| startNonce={1} | ||
| />, | ||
| ); | ||
|
|
||
| expect( | ||
| screen.getByRole("button", { name: /start the count-in/i }), | ||
| ).toBeDisabled(); | ||
| expect( | ||
| screen.getByTestId("rehearsal-loop-next-action").textContent, | ||
| ).not.toMatch(/count in 4 beats/i); | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
|
||
| }); | ||
|
|
||
| it("reports native asset conversion failures instead of presenting missing-audio copy", () => { | ||
| Object.defineProperty(window, "__TAURI_INTERNALS__", { | ||
| configurable: true, | ||
| value: { | ||
| convertFileSrc: () => { | ||
| throw new Error("asset conversion failed"); | ||
| }, | ||
| }, | ||
| }); | ||
| const song = createDemoRehearsalSong(); | ||
|
|
||
| render( | ||
| <RehearsalPlayer | ||
| song={song} | ||
| hasLocalAudio={true} | ||
| audioSourcePath="/Users/test/Music/late-night-set.wav" | ||
| />, | ||
| ); | ||
|
|
||
| expect( | ||
| screen.getByRole("button", { name: /start the count-in/i }), | ||
| ).toBeDisabled(); | ||
| expect(screen.getByRole("alert").textContent).toMatch( | ||
| /could not play this local audio/i, | ||
| ); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.