Update the 34-audio-recording.py example to include an STT processor

This commit is contained in:
Mark Backman
2025-03-15 20:30:35 -04:00
parent 8b86f6991d
commit c1382b0691
2 changed files with 8 additions and 2 deletions

View File

@@ -116,6 +116,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Other ### Other
- Update the `34-audio-recording.py` example to include an STT processor.
- Added a Pipecat Cloud deployment example to the `examples` directory. - Added a Pipecat Cloud deployment example to the `examples` directory.
## [0.0.58] - 2025-02-26 ## [0.0.58] - 2025-02-26

View File

@@ -32,6 +32,7 @@ Requirements:
OPENAI_API_KEY=your_openai_key OPENAI_API_KEY=your_openai_key
CARTESIA_API_KEY=your_cartesia_key CARTESIA_API_KEY=your_cartesia_key
DAILY_API_KEY=your_daily_key DAILY_API_KEY=your_daily_key
DEEPGRAM_API_KEY=your_deepgram_key
The recordings will be saved in a 'recordings' directory with timestamps: The recordings will be saved in a 'recordings' directory with timestamps:
recordings/ recordings/
@@ -65,6 +66,7 @@ from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
from pipecat.processors.audio.audio_buffer_processor import AudioBufferProcessor from pipecat.processors.audio.audio_buffer_processor import AudioBufferProcessor
from pipecat.services.cartesia import CartesiaTTSService from pipecat.services.cartesia import CartesiaTTSService
from pipecat.services.deepgram import DeepgramSTTService
from pipecat.services.openai import OpenAILLMService from pipecat.services.openai import OpenAILLMService
from pipecat.transports.services.daily import DailyParams, DailyTransport from pipecat.transports.services.daily import DailyParams, DailyTransport
@@ -98,13 +100,14 @@ async def main():
DailyParams( DailyParams(
# audio_in_enabled=True, # audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
transcription_enabled=True,
vad_enabled=True, vad_enabled=True,
vad_analyzer=SileroVADAnalyzer(), vad_analyzer=SileroVADAnalyzer(),
vad_audio_passthrough=True, # Enable audio passthrough for recording vad_audio_passthrough=True,
), ),
) )
stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY"), audio_passthrough=True)
tts = CartesiaTTSService( tts = CartesiaTTSService(
api_key=os.getenv("CARTESIA_API_KEY"), api_key=os.getenv("CARTESIA_API_KEY"),
voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", voice_id="71a7ad14-091c-4e8e-a314-022ece01c121",
@@ -128,6 +131,7 @@ async def main():
pipeline = Pipeline( pipeline = Pipeline(
[ [
transport.input(), transport.input(),
stt,
context_aggregator.user(), context_aggregator.user(),
llm, llm,
tts, tts,