Skip to content

fix: correct soundmeter instrument name for chart config and playback#3369

Merged
marcnause merged 1 commit into
fossasia:mainfrom
prajakta128:fix/soundmeter-playback-name
Jun 29, 2026
Merged

fix: correct soundmeter instrument name for chart config and playback#3369
marcnause merged 1 commit into
fossasia:mainfrom
prajakta128:fix/soundmeter-playback-name

Conversation

@prajakta128

@prajakta128 prajakta128 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Problem

Tapping Play on a Sound Meter log in the Logged Data screen did nothing.

The root cause was a name mismatch:

  • _getChartConfig() matched on 'soundmeter' (no space)
  • _playFile() matched on 'sound meter' (with space)
  • The actual value from appLocalizations.soundMeter.toLowerCase() is "sound meter" (with space)

So _getChartConfig never matched, and playback silently fell through.

Fix

Changed case 'soundmeter': to case 'sound meter': in _getChartConfig so both methods use the same string.

Files changed

  • lib/view/logged_data_screen.dart — 1 line changed

Summary by Sourcery

Bug Fixes:

  • Fix sound meter log playback by correcting the instrument name used in chart configuration matching.

@sourcery-ai

sourcery-ai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR fixes playback for Sound Meter logs by aligning the instrument name used in chart configuration with the localized instrument name and the playback logic.

Sequence diagram for Sound Meter log playback fix

sequenceDiagram
  actor User
  participant LoggedDataScreen
  participant _playFile
  participant _getChartConfig

  User->>LoggedDataScreen: tapPlay()
  LoggedDataScreen->>_playFile: _playFile(instrumentName="sound meter")
  _playFile->>_getChartConfig: _getChartConfig(instrumentName="sound meter")
  _getChartConfig-->>_playFile: chartConfig
  _playFile-->>LoggedDataScreen: startPlayback(chartConfig)
  LoggedDataScreen-->>User: audioPlayback
Loading

File-Level Changes

Change Details Files
Align Sound Meter instrument name in chart configuration with the name used for playback, fixing silent playback failures.
  • Update switch-case comparison string in chart configuration helper from "soundmeter" to "sound meter" to match localization and playback logic
  • Ensure Sound Meter logs now return a proper chart config so tapping Play triggers chart rendering and playback instead of falling through
lib/view/logged_data_screen.dart

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions

Copy link
Copy Markdown
Contributor

Build Status

Build successful. APKs to test: https://github.com/fossasia/pslab-app/actions/runs/28309349190/artifacts/7930491213.

Screenshots

Android Screenshots
iPhone Screenshots
iPad Screenshots

@rahul31124 rahul31124 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

_getChartConfig used 'soundmeter' but _playFile used 'sound meter',
causing the chart config to never match and sound meter playback
to silently do nothing. Changed _getChartConfig to use 'sound meter'
to match the value from appLocalizations.soundMeter.toLowerCase().
@marcnause marcnause force-pushed the fix/soundmeter-playback-name branch from 5d01d67 to a00b8ba Compare June 29, 2026 20:32
@marcnause marcnause enabled auto-merge (rebase) June 29, 2026 20:32
@marcnause marcnause merged commit 99ccd51 into fossasia:main Jun 29, 2026
14 of 15 checks passed
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.

3 participants