Comments (3)
Quick update: this proved fairly easy to do 🙂
Am including details in case others wish to attempt something similar. I'm working with a slightly earlier version than the latest code here but I think the principle should be the same.
Within the Audio class in client.py create two functions to stop and start the stream, but importantly the stop (for pausing) does not close the stream, leaving it ready to be restarted.
def pause(self):
"""Temporarily stop the stream listening."""
self.stream.stop_stream()
def restart(self):
"""Restart the stream listening (when previously paused)."""
self.stream.start_stream()
Then within the section where the recognised text is output (ie where you want to do your actions without the mic continuing to listen) call pause() on the vad_audio object at the start of whatever check you're doing and then at the end of the check call restart() and it should be good.
This is handy for my project as I've got it outputting spoken replies using TTS and if you don't pause it then the replies get recognised and it goes into a loop!
Thanks for this v. handy repo @daanzu
from deepspeech-websocket-server.
@nmstoker I'm glad it was easy, and thanks for posting the solution!
from deepspeech-websocket-server.
Hi,
Could you please write an example of "Audio class " including both pause and restart function?
from deepspeech-websocket-server.
Related Issues (11)
- Concurrent streams cause strange recognitions HOT 1
- move audio writing to server from client
- allowing nested calls after recognition
- can't get server running HOT 1
- How to speed up performance? HOT 1
- Update to Coqui STT
- Give client a Python interface HOT 4
- Support for keyword spotting while real time inference HOT 1
- Can we make this code suit for deepspeech0.1? HOT 1
- 500 Internal Server Error on localhost? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepspeech-websocket-server.