voice-router-dev 0.1.9 → 0.2.1

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/dist/index.mjs CHANGED
@@ -2822,7 +2822,7 @@ var AssemblyAIAdapter = class extends BaseAdapter {
2822
2822
  throw new Error("API key is required for streaming");
2823
2823
  }
2824
2824
  const sampleRate = options?.sampleRate || 16e3;
2825
- const encoding = options?.encoding || "pcm_s16le";
2825
+ const encoding = options?.encoding ? mapEncodingToProvider(options.encoding, "assemblyai") : "pcm_s16le";
2826
2826
  const wsUrl = `${this.wsBaseUrl}?sample_rate=${sampleRate}&encoding=${encoding}`;
2827
2827
  const ws = new WebSocket2(wsUrl, {
2828
2828
  headers: {
@@ -2919,12 +2919,7 @@ var AssemblyAIAdapter = class extends BaseAdapter {
2919
2919
  if (ws.readyState !== WebSocket2.OPEN) {
2920
2920
  throw new Error("WebSocket is not open");
2921
2921
  }
2922
- const base64Audio = chunk.data.toString("base64");
2923
- ws.send(
2924
- JSON.stringify({
2925
- audio_data: base64Audio
2926
- })
2927
- );
2922
+ ws.send(chunk.data);
2928
2923
  if (chunk.isLast) {
2929
2924
  ws.send(
2930
2925
  JSON.stringify({