Skip to content

12155 Share audio to cloud with correct number of channels - #12157

Merged
embarc-gabriel merged 1 commit into
audacity:masterfrom
embarc-gabriel:12155-share-audio-considering-num-channels
Sep 21, 2026
Merged

embarc-gabriel merged 1 commit into
audacity:masterfrom
embarc-gabriel:12155-share-audio-considering-num-channels

Conversation

@embarc-gabriel

Copy link
Copy Markdown
Contributor

Resolves: #12155

Get the number of channels from the project content.

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • Testflow test cases have been run

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

📝 Walkthrough

Walkthrough

The change adds a shared helper that selects ExportChannels::MONO when all wave tracks have one channel and zero pan. updateAudioPreview and shareAudio use this channel type instead of setting fixed channel counts. shareAudio now returns an InternalError with "Invalid project" when the project pointer is null.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: 🟡 Moderate · up to 7cce2

Switching projects while sharing can upload audio from the wrong project. The export must remain bound to the requested project before merge.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: sharing audio to the cloud with the correct channel count. It is concise and specific.
Description check ✅ Passed The description includes the issue reference, change summary, motivation, and completed checklist items. The Testflow test cases checkbox is not marked, but this is a non-critical QA detail and the de…
Linked Issues check ✅ Passed The change addresses #12155. exportChannelsType returns MONO when all wave tracks have one channel and zero pan. Both updateAudioPreview and shareAudio pass this channel type to the cloud expo…
Out of Scope Changes check ✅ Passed The changes stay within #12155. The helper centralizes channel selection for cloud export. The null-project error handling prevents dereferencing an invalid project in the same export path. No unrelat…

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/musescore.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: a3e38c03-a044-4c91-8425-405f5dbda609

📥 Commits

Reviewing files that changed from the base of the PR and between 58ca477 and 7cce26a.

📒 Files selected for processing (1)
  • src/au3cloud/internal/au3audiocomservice.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

options[importexport::IExporter::OptionKey::ExportChannelsType]
= muse::Val(static_cast<int>(importexport::ExportChannelsPref::ExportChannels::STEREO));
options[importexport::IExporter::OptionKey::ExportChannels] = muse::Val(2);
= muse::Val(static_cast<int>(exportChannelsType(*au3Project)));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Pass project to exportData in shareAudio.

shareAudio computes ExportChannelsType from its captured project. The call at line 1049 omits that project. Au3Exporter::exportData then reads globalContext()->currentProject() and uses it for the audio tracks and processor. Because shareAudio runs in a detached thread, the active project can change between these operations. The exporter can therefore apply one project's channel type to another project's audio. Pass project as the fourth argument.

@embarc-gabriel
embarc-gabriel force-pushed the 12155-share-audio-considering-num-channels branch from 7cce26a to 83a24c5 Compare September 21, 2026 14:19
@embarc-gabriel
embarc-gabriel merged commit e77c729 into audacity:master Sep 21, 2026
9 of 10 checks passed
kryksyh added a commit that referenced this pull request Sep 22, 2026
12155 Share audio to cloud with correct number of channels (#12157)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mono cloud audio is imported as stereo

2 participants