Skip to content

Add stopPlayer method to stop current audio playback#14

Open
inakiabt wants to merge 1 commit into
speechmatics:mainfrom
inakiabt:feat/player-stop
Open

Add stopPlayer method to stop current audio playback#14
inakiabt wants to merge 1 commit into
speechmatics:mainfrom
inakiabt:feat/player-stop

Conversation

@inakiabt

Copy link
Copy Markdown

This pull request adds a new feature to both the Android and iOS audio modules, allowing the audio player to be stopped programmatically from the JavaScript layer. The implementation includes native methods for stopping playback and updates the TypeScript API to expose this functionality.

New stop player functionality:

  • Added a stopPlayer function to the TypeScript API in src/core.ts, which calls the native module's stop method.
  • Implemented a stopPlayer method in the Android AudioEngine class that clears the audio queue, stops playback, and resets the output volume.
  • Exposed the stopPlayer method as a callable function in the Android ExpoTwoWayAudioModule class.
  • Implemented a stopPlayer method in the iOS AudioEngine class that stops the speech player and updates the output volume.
  • Exposed the stopPlayer method as a callable function in the iOS ExpoTwoWayAudioModule class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants