-
Notifications
You must be signed in to change notification settings - Fork 26
feat: 完成跨平台音频播放模块 #122
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
Merged
feat: 完成跨平台音频播放模块 #122
Conversation
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
Closed
@shimoranla |
lhx077
approved these changes
May 31, 2025
whitecat346
approved these changes
May 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work
头疼 |
让我再修改一下 |
彳亍,你可以先Draft,做好了再Ready |
其实是已经在WindowsAudioService里做好了,但是不知道为什么两块是散的,没有整合到一起 |
whitecat346
pushed a commit
to whitecat346/PCL.Neo
that referenced
this pull request
Jun 6, 2025
feat: 完成跨平台音频播放模块
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.
PCL.Neo 跨平台音频系统 PR
概述
本PR为PCL.Neo启动器添加了完整的跨平台音频播放系统,可在Windows、macOS和Linux系统上播放音频文件,无需额外的第三方依赖。系统设计灵活,提供了统一的接口和平台特定的优化实现。
主要功能
详细修改内容
核心架构
IAudioService
接口定义了音频播放的核心功能AudioService
基类实现了通用的跨平台播放功能WindowsAudioService
提供Windows平台特定的优化实现AudioServiceFactory
工厂类根据当前平台自动创建合适的音频服务AudioPlayerExtensions
提供便捷的扩展方法OnPlaybackFinished
受保护方法提供安全的事件触发机制分平台实现
Windows
macOS 和 Linux
额外功能
添加的文件
接口和基础类:
PCL.Neo.Core/Service/Audio/IAudioService.cs
- 音频服务接口PCL.Neo.Core/Service/Audio/AudioOptions.cs
- 音频配置选项PCL.Neo.Core/Service/Audio/AudioService.cs
- 基础实现类平台特定实现:
PCL.Neo.Core/Service/Audio/WindowsAudioService.cs
- Windows平台实现工具和扩展:
PCL.Neo.Core/Service/Audio/AudioServiceFactory.cs
- 音频服务工厂PCL.Neo.Core/Service/Audio/AudioPlayerExtensions.cs
- 扩展方法示例和文档:
PCL.Neo.Core/Service/Audio/AudioDemo.cs
- 示例代码PCL.Neo.Core/Service/Audio/README.md
- 使用文档使用示例
扩展和自定义
注意事项