@glydeunity/voice-sdk 1.6.28 → 1.6.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/glyde-chat.umd.js +14 -14
- package/dist/glyde-chat.umd.js.map +1 -1
- package/dist/index.d.ts +19 -2
- package/dist/voice-sdk.es.js +4172 -4687
- package/dist/voice-sdk.es.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -736,6 +736,7 @@ export declare class GlydeText extends BaseGlydeClient<GlydeTextConfig, TextChat
|
|
|
736
736
|
private contextSwitchManager;
|
|
737
737
|
private currentContextType;
|
|
738
738
|
private agentMetadata;
|
|
739
|
+
private initPromise;
|
|
739
740
|
/**
|
|
740
741
|
* Create a new GlydeText instance
|
|
741
742
|
* @param config - Configuration options
|
|
@@ -758,6 +759,10 @@ export declare class GlydeText extends BaseGlydeClient<GlydeTextConfig, TextChat
|
|
|
758
759
|
* @returns Array with the greeting message
|
|
759
760
|
*/
|
|
760
761
|
initialize(): Promise<ChatMessage[]>;
|
|
762
|
+
/**
|
|
763
|
+
* Internal initialization logic (called exactly once)
|
|
764
|
+
*/
|
|
765
|
+
private doInitialize;
|
|
761
766
|
/**
|
|
762
767
|
* Get a context-appropriate greeting for non-screening contexts
|
|
763
768
|
* @returns Greeting message based on context type
|
|
@@ -904,6 +909,7 @@ export declare class GlydeVoice extends BaseGlydeClient<GlydeVoiceConfig, VoiceE
|
|
|
904
909
|
private microphoneStarted;
|
|
905
910
|
private readonly outputSampleRate;
|
|
906
911
|
private readonly inputSampleRate;
|
|
912
|
+
private readonly playbackSpeed;
|
|
907
913
|
private isAgentSpeaking;
|
|
908
914
|
private agentAudioDoneReceived;
|
|
909
915
|
private contextSwitchManager;
|
|
@@ -962,9 +968,12 @@ export declare class GlydeVoice extends BaseGlydeClient<GlydeVoiceConfig, VoiceE
|
|
|
962
968
|
*/
|
|
963
969
|
private handleAudioBuffer;
|
|
964
970
|
/**
|
|
965
|
-
* Resample audio from 24kHz to 48kHz
|
|
971
|
+
* Resample audio from 24kHz to the AudioContext rate (48kHz), adjusted for
|
|
972
|
+
* playback speed. At speed 1.0 the ratio is 2x (standard 24k->48k upsample).
|
|
973
|
+
* Higher speeds produce fewer output samples per input sample, causing the
|
|
974
|
+
* worklet to drain the buffer faster and the speech to sound faster.
|
|
966
975
|
*/
|
|
967
|
-
private
|
|
976
|
+
private resampleToPlaybackRate;
|
|
968
977
|
/**
|
|
969
978
|
* Clear the playback buffer (for interruption handling)
|
|
970
979
|
*/
|
|
@@ -1119,6 +1128,14 @@ export declare interface GlydeVoiceConfig extends BaseGlydeConfig {
|
|
|
1119
1128
|
limitToLast?: number;
|
|
1120
1129
|
/** Override Deepgram configuration (e.g. model, tags). System prompt and greeting remain server-controlled. */
|
|
1121
1130
|
deepgramConfig?: DeepgramAgentConfig;
|
|
1131
|
+
/**
|
|
1132
|
+
* Playback speed multiplier for agent speech audio.
|
|
1133
|
+
* 1.0 = normal speed, 1.2 = 20% faster, 0.8 = 20% slower.
|
|
1134
|
+
* Adjusts the resampling ratio rather than using Web Audio playbackRate,
|
|
1135
|
+
* so it introduces slight pitch shift proportional to the speed change.
|
|
1136
|
+
* Recommended range: 0.8 - 1.5. Default: 1.2
|
|
1137
|
+
*/
|
|
1138
|
+
playbackSpeed?: number;
|
|
1122
1139
|
/**
|
|
1123
1140
|
* Additional tool/function definitions to merge with server-provided functions.
|
|
1124
1141
|
* Server-defined functions are always included; this allows adding extra tools only.
|