You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrapped _sharedAudioPlaybackDevice.Rent() in AudioService.cs with a try-catch block to handle ObjectDisposedException, preventing crashes during rapid re-initialization or concurrent access.
Populated AudioFileTypes in NotificationSettingsPage.axaml.cs with common audio extensions (*.wav, *.mp3, *.ogg, *.flac, *.m4a, *.wma, *.aac) and FilePickerFileTypes.All to allow users to select custom sound files.
This change addresses a critical bug where the application would crash when attempting to play a notification sound due to a race condition in `AudioService.cs` when renting a shared `AudioPlaybackDevice`. It adds a `try-catch` block for `ObjectDisposedException` to safely handle disposed devices and re-initialize them.
Additionally, it fixes an issue where users could not select custom notification sound files because the `AudioFileTypes` list in `NotificationSettingsPage.axaml.cs` was empty. Common audio file extensions and an "All files" option have been added.
FixesClassIsland#1485
Co-authored-by: kaokao221 <88539021+kaokao221@users.noreply.github.com>
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.
When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.
I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!
For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!
This commit addresses a critical application crash (Access Violation) caused by rapid initialization and disposal of the audio device (miniaudio backend) when playing notification sounds.
Changes:
- Implemented a debounce mechanism in `AudioService.cs` using `System.Threading.Timer` to keep the shared `AudioPlaybackDevice` alive for 5 seconds after the last use. This prevents rapid re-initialization cycles that were triggering the native crash.
- Added a `try-catch` block for `ObjectDisposedException` when renting the audio device as an additional safety measure.
- Populated `AudioFileTypes` in `NotificationSettingsPage.axaml.cs` with common audio file extensions (*.wav, *.mp3, *.ogg, *.flac, *.m4a, *.wma, *.aac) and `FilePickerFileTypes.All` to allow users to select custom sound files, fixing an issue where the file picker filter was empty.
FixesClassIsland#1485
Co-authored-by: kaokao221 <88539021+kaokao221@users.noreply.github.com>
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
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.
_sharedAudioPlaybackDevice.Rent()inAudioService.cswith atry-catchblock to handleObjectDisposedException, preventing crashes during rapid re-initialization or concurrent access.AudioFileTypesinNotificationSettingsPage.axaml.cswith common audio extensions (*.wav, *.mp3, *.ogg, *.flac, *.m4a, *.wma, *.aac) andFilePickerFileTypes.Allto allow users to select custom sound files.PR created automatically by Jules for task 15160178287493207890 started by @kaokao221