Skip to content

feat: Implement audiosprite generation and looping background music\n…#2

Merged
qalqi merged 6 commits intomainfrom
main_feat_bgm
Nov 5, 2025
Merged

feat: Implement audiosprite generation and looping background music\n…#2
qalqi merged 6 commits intomainfrom
main_feat_bgm

Conversation

@qalqi
Copy link
Owner

@qalqi qalqi commented Nov 5, 2025

…\n- Create script to generate audiosprite with howler format and looping background music.\n- Update AudioSpritePlayer to support howler format and looping on both web and mobile.\n- Update tests, README, and examples.

qalqi added 3 commits November 6, 2025 02:44
…\n- Create script to generate audiosprite with howler format and looping background music.\n- Update AudioSpritePlayer to support howler format and looping on both web and mobile.\n- Update tests, README, and examples.
@qalqi
Copy link
Owner Author

qalqi commented Nov 5, 2025

  • _cacheSpriteBuffers Fix & JSDoc: Corrected _cacheSpriteBuffers to properly account for audio sprite duration and added comprehensive JSDoc with a sample JSON structure.
  • BGM Stop Method: Implemented a stop() method in AudioSpritePlayer to allow stopping of looping background music, particularly for mobile scenarios.
  • Improved Web Playback: Updated web playback logic to utilize cached sprite buffers and correctly handle looping sounds using source.start() without duration, setting loopStart and loopEnd relative to the sprite buffer.
  • Mobile Looping with onEnded: Modified mobile looping to use source.onEnded for continuous playback, addressing limitations of AudioBufferQueueSourceNode regarding loop properties.
  • Example App Enhancement: Replaced all Button components with TouchableOpacity in example/src/App.tsx for better styling and added a "Stop BGM" button.
  • Documentation Update: Updated README.md to reflect all new features, usage instructions, and code examples.
  • Test Coverage: Updated existing tests and added new ones to ensure full coverage and correctness of the implemented changes.

@qalqi qalqi merged commit 1b53962 into main Nov 5, 2025
4 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.

1 participant

Comments