Skip to content

Commit

Permalink
Fix audio event types
Browse files Browse the repository at this point in the history
  • Loading branch information
mnemitz committed Oct 31, 2024
1 parent f6d6704 commit 860983b
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 52 deletions.
14 changes: 6 additions & 8 deletions packages/real-time-client/models/audio-event-ended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
* Do not edit the class manually.
*/

// May contain unused imports in some cases
// @ts-ignore
import type { AudioEventEndedEvent } from './audio-event-ended-event';

/**
*
* @export
Expand All @@ -26,16 +30,10 @@ export interface AudioEventEnded {
message?: AudioEventEndedMessageEnum;
/**
*
* @type {string}
* @memberof AudioEventEnded
*/
type?: string;
/**
*
* @type {number}
* @type {AudioEventEndedEvent}
* @memberof AudioEventEnded
*/
end_time?: number;
event?: AudioEventEndedEvent;
}

export const AudioEventEndedMessageEnum = {
Expand Down
20 changes: 6 additions & 14 deletions packages/real-time-client/models/audio-event-started.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
* Do not edit the class manually.
*/

// May contain unused imports in some cases
// @ts-ignore
import type { AudioEventStartedEvent } from './audio-event-started-event';

/**
*
* @export
Expand All @@ -26,22 +30,10 @@ export interface AudioEventStarted {
message?: AudioEventStartedMessageEnum;
/**
*
* @type {string}
* @memberof AudioEventStarted
*/
type?: string;
/**
*
* @type {number}
* @memberof AudioEventStarted
*/
start_time?: number;
/**
*
* @type {number}
* @type {AudioEventStartedEvent}
* @memberof AudioEventStarted
*/
confidence?: number;
event?: AudioEventStartedEvent;
}

export const AudioEventStartedMessageEnum = {
Expand Down
2 changes: 1 addition & 1 deletion packages/real-time-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@speechmatics/real-time-client",
"version": "5.0.1",
"version": "5.0.2",
"description": "Client for the Speechmatics real-time API",
"main": "dist/index.js",
"browser": "dist/index.browser.js",
Expand Down
44 changes: 28 additions & 16 deletions packages/real-time-client/schema/realtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,24 @@ components:
message:
enum:
- AudioEventStarted
type:
type: string
start_time:
type: number
format: float
confidence:
type: number
format: float
event:
type: object
properties:
type:
type: string
start_time:
type: number
format: float
confidence:
type: number
format: float
required:
- type
- start_time
- confidence
required:
- message
- type
- start_time
- confidence
- event
AudioEventEnded:
summary: End of an audio event detected.
payload:
Expand All @@ -263,11 +268,18 @@ components:
message:
enum:
- AudioEventEnded
type:
type: string
end_time:
type: number
format: float
event:
type: object
properties:
type:
type: string
end_time:
type: number
format: float
required:
- type
- end_time

required:
- message
- type
Expand Down
39 changes: 26 additions & 13 deletions packages/real-time-client/scripts/openapi-transformed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,25 +168,38 @@ components:
message:
enum:
- AudioEventStarted
type:
type: string
start_time:
type: number
format: float
confidence:
type: number
format: float
event:
type: object
properties:
type:
type: string
start_time:
type: number
format: float
confidence:
type: number
format: float
required:
- type
- start_time
- confidence
AudioEventEnded:
type: object
properties:
message:
enum:
- AudioEventEnded
type:
type: string
end_time:
type: number
format: float
event:
type: object
properties:
type:
type: string
end_time:
type: number
format: float
required:
- type
- end_time
Info:
type: object
properties:
Expand Down

0 comments on commit 860983b

Please sign in to comment.