This repository has been archived by the owner on May 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow speech pipeline to be paused
This adds `pause` and `resume` methods to the speech pipeline to allow listening to be temporarily suspsended without fully releasing the pipeline's resources. In turn, `prepare` and `release` in the `Spokestack` wrapper have been removed, with `start` and `stop` controlling the resources of all modules instead of just the speech pipeline. `pause` and `resume` have been threaded through the wrapper and are automatically called by TTS events.
- Loading branch information
1 parent
14123ce
commit cc28147
Showing
5 changed files
with
257 additions
and
81 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
26 changes: 26 additions & 0 deletions
26
src/test/java/io/spokestack/spokestack/SpeechTestUtils.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.spokestack.spokestack; | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
/** | ||
* Test classes related to the speech pipeline used in more than one test | ||
* suite. | ||
*/ | ||
public class SpeechTestUtils { | ||
|
||
public static class FreeInput implements SpeechInput { | ||
public static int counter; | ||
|
||
public FreeInput(SpeechConfig config) { | ||
counter = 0; | ||
} | ||
|
||
public void close() { | ||
counter = -1; | ||
} | ||
|
||
public void read(SpeechContext context, ByteBuffer frame) { | ||
frame.putInt(0, ++counter); | ||
} | ||
} | ||
} |
Oops, something went wrong.