@breeze.blue/sdk 0.17.0 → 0.18.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.0
4
+
5
+ - Create asynchronous speech jobs with word timestamps and read timing from completed job results.
6
+
3
7
  ## 0.17.0
4
8
 
5
9
  - Generate synchronous speech or stream audio with word timestamps and safe stream cleanup.
package/README.md CHANGED
@@ -436,7 +436,8 @@ console.log(metadataOptions.accentCodesByLanguage.en);
436
436
 
437
437
  Voice listings keep the published default of stable creation-time order from
438
438
  newest to oldest. Use `{ sort: "trend", voiceType: "default" }` for the shared
439
- Daily Trend order. Search queries remain relevance-ranked; Trend is only a
439
+ Daily Trend order. Eligible voices not yet ranked follow the snapshot members;
440
+ returned page tokens pin the initial supplemental candidates. Search queries remain relevance-ranked; Trend is only a
440
441
  weak prior within the same relevance tier.
441
442
 
442
443
  Breeze voice creation is always two steps: produce a **preview**, let the
@@ -609,3 +610,5 @@ Pass `voiceSettings: { volume: 1.5 }` to apply a request-level linear amplitude
609
610
  Stream audio and word/token timestamps with `client.textToSpeech.streamWithTimestamps(...)`. Use `for await` to consume chunks containing `audioBase64` and `wordTimestamps`; breaking iteration closes the stream. Decode the audio separately and merge repeated word indices. See [Speech timing](https://docs.breezeblue.ai/guides/speech-timing) for complete examples and timing semantics.
610
611
 
611
612
  For a complete response, use `client.textToSpeech.convertWithTimestamps(...)`. It returns base64 audio, its content type, and the full word/token timestamp list. Decode the audio before saving or playback. See [Speech timing](https://docs.breezeblue.ai/guides/speech-timing) and [Convert with timestamps](https://docs.breezeblue.ai/api-reference/text-to-speech/convert-with-timestamps).
613
+
614
+ For background generation with timing, use `client.textToSpeech.createJobWithTimestamps(...)`. Poll with `client.generationJobs.get(jobId)`; a ready job includes `wordTimestamps` and the audio download URL.
package/dist/client.d.ts CHANGED
@@ -26,6 +26,7 @@ declare class TextToSpeechResource {
26
26
  constructor(client: BreezeBlueClient);
27
27
  convert(voiceId: string, request: TextToSpeechRequest, options?: AudioRequestOptions): Promise<AudioResponse>;
28
28
  createJob(voiceId: string, request: TextToSpeechRequest, options?: AudioRequestOptions): Promise<AsyncTextToSpeechJob>;
29
+ createJobWithTimestamps(voiceId: string, request: TextToSpeechRequest, options?: AudioRequestOptions): Promise<AsyncTextToSpeechJob>;
29
30
  stream(voiceId: string, request: TextToSpeechRequest, options?: StreamTextToSpeechOptions): Promise<AudioResponse>;
30
31
  convertWithTimestamps(voiceId: string, request: TextToSpeechRequest, options?: AudioRequestOptions): Promise<SpeechWithTimestamps>;
31
32
  streamWithTimestamps(voiceId: string, request: TextToSpeechRequest & {
package/dist/client.js CHANGED
@@ -113,6 +113,9 @@ class TextToSpeechResource {
113
113
  createJob(voiceId, request, options = {}) {
114
114
  return this.client.requestJson("POST", `/v1/text-to-speech/${encodeURIComponent(voiceId)}`, { outputFormat: options.outputFormat, delivery: "async" }, request, options);
115
115
  }
116
+ createJobWithTimestamps(voiceId, request, options = {}) {
117
+ return this.client.requestJson("POST", `/v1/text-to-speech/${encodeURIComponent(voiceId)}/with-timestamps`, { outputFormat: options.outputFormat, delivery: "async" }, request, options);
118
+ }
116
119
  stream(voiceId, request, options = {}) {
117
120
  return this.client.requestAudio("POST", `/v1/text-to-speech/${encodeURIComponent(voiceId)}/stream`, {
118
121
  outputFormat: options.outputFormat,
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { VoiceAccent, VoiceAge, VoiceGender, VoiceLanguageCode, VoiceTone } from "./voice-metadata.js";
1
+ import type { WordTimestamp } from "./timestamps.js";
2
+ import type { VoiceAccent, VoiceWritableAccent, VoiceAge, VoiceGender, VoiceLanguageCode, VoiceTone } from "./voice-metadata.js";
2
3
  export type JsonObject = Record<string, unknown>;
3
4
  export type BreezeBlueFetch = typeof fetch;
4
5
  export interface BreezeBlueClientOptions {
@@ -276,6 +277,7 @@ export interface GenerationJobError {
276
277
  detail: string;
277
278
  }
278
279
  export interface GenerationJob {
280
+ wordTimestamps?: WordTimestamp[];
279
281
  generationJobId: string;
280
282
  historyItemId: string;
281
283
  status: string;
@@ -359,7 +361,7 @@ export interface VoiceMetadataOptions {
359
361
  ageCodes: VoiceAge[];
360
362
  toneCodes: VoiceTone[];
361
363
  toneMaxItems: number;
362
- accentCodesByLanguage: Record<VoiceLanguageCode, VoiceAccent[]>;
364
+ accentCodesByLanguage: Record<VoiceLanguageCode, VoiceWritableAccent[]>;
363
365
  }
364
366
  export interface VoiceRandomParams {
365
367
  /** Only pick from voices whose saved audio language matches this code. */
@@ -375,6 +377,7 @@ export interface VoiceSearchParams {
375
377
  age?: VoiceAge[];
376
378
  tone?: VoiceTone[];
377
379
  accent?: VoiceAccent;
380
+ accentMode?: "all" | "unmarked";
378
381
  origin?: "designed" | "cloned" | string;
379
382
  voiceType?: "all" | "default" | "personal" | string;
380
383
  sort?: "created_at_unix" | "name" | "trend" | string;
@@ -418,7 +421,7 @@ export interface VoiceEditRequest {
418
421
  gender?: VoiceGender | null;
419
422
  age?: VoiceAge | null;
420
423
  tone?: VoiceTone[];
421
- accent?: VoiceAccent | null;
424
+ accent?: VoiceWritableAccent | null;
422
425
  file?: UploadData | UploadFile;
423
426
  files?: Array<UploadData | UploadFile>;
424
427
  }
@@ -480,7 +483,7 @@ export interface SaveVoiceRequest {
480
483
  gender?: VoiceGender | null;
481
484
  age?: VoiceAge | null;
482
485
  tone?: VoiceTone[];
483
- accent?: VoiceAccent | null;
486
+ accent?: VoiceWritableAccent | null;
484
487
  }
485
488
  export interface HistoryItem {
486
489
  historyItemId: string;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.17.0";
1
+ export declare const SDK_VERSION = "0.18.0";
2
2
  export declare const SDK_NAME = "@breeze.blue/sdk";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const SDK_VERSION = "0.17.0";
1
+ export const SDK_VERSION = "0.18.0";
2
2
  export const SDK_NAME = "@breeze.blue/sdk";
@@ -5,10 +5,14 @@ export declare const VOICE_LANGUAGE_CODES: readonly ["af", "ar", "bg", "bn", "bs
5
5
  export declare const VOICE_TONE_MAX_ITEMS: 3;
6
6
  export declare const VOICE_ACCENT_CODES_BY_LANGUAGE: {
7
7
  readonly en: readonly ["american", "british", "scottish", "irish", "australian", "canadian", "us_southern", "us_new_york", "indian", "south_african", "russian", "japanese", "korean", "chinese"];
8
- readonly zh: readonly ["mandarin_guangdong", "mandarin_northeastern", "mandarin_shaanxi", "mandarin_shanghai", "mandarin_sichuan", "mandarin_yunnan", "mandarin_henan", "cantonese"];
8
+ readonly zh: readonly ["mandarin_northeastern", "mandarin_shaanxi", "mandarin_shanghai", "mandarin_sichuan", "mandarin_henan", "mandarin_beijing", "mandarin_taiwan", "cantonese"];
9
9
  };
10
10
  export type VoiceGender = (typeof VOICE_GENDER_CODES)[number];
11
11
  export type VoiceAge = (typeof VOICE_AGE_CODES)[number];
12
12
  export type VoiceTone = (typeof VOICE_TONE_CODES)[number];
13
13
  export type VoiceLanguageCode = (typeof VOICE_LANGUAGE_CODES)[number];
14
- export type VoiceAccent = (typeof VOICE_ACCENT_CODES_BY_LANGUAGE)[keyof typeof VOICE_ACCENT_CODES_BY_LANGUAGE][number];
14
+ export declare const VOICE_LEGACY_ACCENT_CODES_BY_LANGUAGE: {
15
+ readonly zh: readonly ["mandarin_guangdong", "mandarin_yunnan"];
16
+ };
17
+ export type VoiceWritableAccent = (typeof VOICE_ACCENT_CODES_BY_LANGUAGE)[keyof typeof VOICE_ACCENT_CODES_BY_LANGUAGE][number];
18
+ export type VoiceAccent = VoiceWritableAccent | "mandarin_guangdong" | "mandarin_yunnan";
@@ -6,5 +6,6 @@ export const VOICE_LANGUAGE_CODES = ["af", "ar", "bg", "bn", "bs", "ca", "cs", "
6
6
  export const VOICE_TONE_MAX_ITEMS = 3;
7
7
  export const VOICE_ACCENT_CODES_BY_LANGUAGE = {
8
8
  en: ["american", "british", "scottish", "irish", "australian", "canadian", "us_southern", "us_new_york", "indian", "south_african", "russian", "japanese", "korean", "chinese"],
9
- zh: ["mandarin_guangdong", "mandarin_northeastern", "mandarin_shaanxi", "mandarin_shanghai", "mandarin_sichuan", "mandarin_yunnan", "mandarin_henan", "cantonese"],
9
+ zh: ["mandarin_northeastern", "mandarin_shaanxi", "mandarin_shanghai", "mandarin_sichuan", "mandarin_henan", "mandarin_beijing", "mandarin_taiwan", "cantonese"],
10
10
  };
11
+ export const VOICE_LEGACY_ACCENT_CODES_BY_LANGUAGE = { "zh": ["mandarin_guangdong", "mandarin_yunnan"] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breeze.blue/sdk",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "ESM-first TypeScript SDK for the Breeze Blue Developer API.",
5
5
  "license": "MIT",
6
6
  "author": "Breeze Blue <support@breezeblue.ai>",