spatialreal 0.3.0__tar.gz → 0.4.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: spatialreal
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: SpatialReal Python SDK — realtime avatar sessions (audio in, animation/egress out)
5
5
  Project-URL: Documentation, https://docs.spatialreal.ai
6
6
  Project-URL: Website, https://www.spatialreal.ai/
@@ -64,30 +64,33 @@ await session.interrupt() # interrupts the latest request
64
64
  await session.close()
65
65
  ```
66
66
 
67
- ### Agora source-timeline-only viewers
68
-
69
- Set `AgoraEgressConfig(source_timeline_only=True, ...)` only when every viewer
70
- plays the source-timeline audio and manages its own entry transition. The default
71
- is `False`, which retains the existing RTC delivery policy. This setting does not
72
- change input sample rates or audio data.
73
-
74
- `start()` requires the server's `agora_source_timeline_only` capability when this
75
- mode is requested. A confirmation without it raises `UnsupportedConfigurationError`
76
- (`protocolError`, `websocket_handshake`, not retryable) and closes the connection
77
- before audio is sent. A standard WebSocket policy rejection (`1008`) is also not
78
- retryable. Other transport failures retain their normal retry behavior.
79
-
80
- For the coordinated bounded-burst profile, also set
81
- `source_playback_profile=RtcSourcePlaybackProfile.BOUNDED_BURST_V1` (import the
82
- enum from `spatialreal`). It requires `source_timeline_only=True` and both
83
- `agora_source_timeline_only` and `agora_source_burst_v1` in the server's actual
84
- confirmation. `session.capabilities` is the read-only tuple from that handshake.
85
- Missing acceptance closes the connection before the read loop or audio starts;
86
- there is no silent fallback. The default `UNSPECIFIED`/0 is omitted on the wire
87
- and retains existing behavior. Unknown values and booleans are rejected.
88
-
89
- Every animation viewer must independently opt into the same profile using a
90
- compatible viewer SDK; the publisher's handshake cannot negotiate room viewers.
67
+ ### Agora playback defaults
68
+
69
+ `AgoraEgressConfig(channel_name=..., token=..., uid=...)` defaults to
70
+ `source_timeline_only=True` and `BOUNDED_BURST_V1`. Current SpatialReal Web SDK
71
+ viewers detect this profile from the actual media, so no playback flags are
72
+ needed on either side. Audio input formats and sample rates are unchanged.
73
+
74
+ Before sending audio, `start()` requires both `agora_source_timeline_only` and
75
+ `agora_source_burst_v1` in the server's actual confirmation. Missing acceptance
76
+ raises `UnsupportedConfigurationError` (`protocolError`, `websocket_handshake`,
77
+ not retryable) and closes the connection. Policy rejection (`1008`) is also not
78
+ retryable; ordinary transport failures retain their existing retry policy.
79
+ `session.capabilities` is the read-only tuple from the handshake.
80
+
81
+ For older viewers that require native audio, explicitly set
82
+ `source_timeline_only=False`; the omitted profile then resolves to
83
+ `RtcSourcePlaybackProfile.UNSPECIFIED`/0. An explicit `source_playback_profile=0`
84
+ with source-only enabled preserves the earlier source-only contract. `None`
85
+ selects the profile from `source_timeline_only`; booleans and unknown profile
86
+ values are rejected. Burst with source-only disabled is invalid.
87
+
88
+ This changes the default for Agora publishers and requires a compatible server
89
+ and viewer SDK. The publisher handshake cannot discover or upgrade room viewers.
90
+ An incompatible server fails explicitly rather than silently falling back. Use a
91
+ Web SDK build with automatic profile detection, or explicitly configure
92
+ `agora.sourcePlaybackProfile: "bounded-burst-v1"` on Web SDK 1.0.0-beta.6.
93
+ Upgrading the publisher alone does not upgrade existing viewers.
91
94
 
92
95
  ### Pause / resume (egress mode)
93
96
 
@@ -127,6 +130,13 @@ implements the server's WebSocket close-code contract (40xx: don't retry,
127
130
 
128
131
  ## What's new
129
132
 
133
+ - 0.4.0: **Behaviour change** — the Agora publisher default is now source-timeline-only
134
+ playback with the bounded burst profile: a plain `AgoraEgressConfig(channel_name=..., token=..., uid=...)`
135
+ requests `source_timeline_only=True` and `BOUNDED_BURST_V1`. Viewers need a Web SDK with
136
+ automatic profile detection (1.0.0-beta.7+), or must set
137
+ `agora.sourcePlaybackProfile: 'bounded-burst-v1'` explicitly on 1.0.0-beta.6. Pass
138
+ `source_timeline_only=False` for compatibility mode (older/native-audio viewers); the
139
+ omitted profile then resolves to zero. Server capability checks remain mandatory.
130
140
  - 0.3.0: Agora source playback negotiation. `AgoraEgressConfig(source_timeline_only=True)`
131
141
  requests source-timeline-only playback; `source_playback_profile=RtcSourcePlaybackProfile.BOUNDED_BURST_V1`
132
142
  requests the bounded source playback profile. `start()` refuses the session
@@ -31,30 +31,33 @@ await session.interrupt() # interrupts the latest request
31
31
  await session.close()
32
32
  ```
33
33
 
34
- ### Agora source-timeline-only viewers
35
-
36
- Set `AgoraEgressConfig(source_timeline_only=True, ...)` only when every viewer
37
- plays the source-timeline audio and manages its own entry transition. The default
38
- is `False`, which retains the existing RTC delivery policy. This setting does not
39
- change input sample rates or audio data.
40
-
41
- `start()` requires the server's `agora_source_timeline_only` capability when this
42
- mode is requested. A confirmation without it raises `UnsupportedConfigurationError`
43
- (`protocolError`, `websocket_handshake`, not retryable) and closes the connection
44
- before audio is sent. A standard WebSocket policy rejection (`1008`) is also not
45
- retryable. Other transport failures retain their normal retry behavior.
46
-
47
- For the coordinated bounded-burst profile, also set
48
- `source_playback_profile=RtcSourcePlaybackProfile.BOUNDED_BURST_V1` (import the
49
- enum from `spatialreal`). It requires `source_timeline_only=True` and both
50
- `agora_source_timeline_only` and `agora_source_burst_v1` in the server's actual
51
- confirmation. `session.capabilities` is the read-only tuple from that handshake.
52
- Missing acceptance closes the connection before the read loop or audio starts;
53
- there is no silent fallback. The default `UNSPECIFIED`/0 is omitted on the wire
54
- and retains existing behavior. Unknown values and booleans are rejected.
55
-
56
- Every animation viewer must independently opt into the same profile using a
57
- compatible viewer SDK; the publisher's handshake cannot negotiate room viewers.
34
+ ### Agora playback defaults
35
+
36
+ `AgoraEgressConfig(channel_name=..., token=..., uid=...)` defaults to
37
+ `source_timeline_only=True` and `BOUNDED_BURST_V1`. Current SpatialReal Web SDK
38
+ viewers detect this profile from the actual media, so no playback flags are
39
+ needed on either side. Audio input formats and sample rates are unchanged.
40
+
41
+ Before sending audio, `start()` requires both `agora_source_timeline_only` and
42
+ `agora_source_burst_v1` in the server's actual confirmation. Missing acceptance
43
+ raises `UnsupportedConfigurationError` (`protocolError`, `websocket_handshake`,
44
+ not retryable) and closes the connection. Policy rejection (`1008`) is also not
45
+ retryable; ordinary transport failures retain their existing retry policy.
46
+ `session.capabilities` is the read-only tuple from the handshake.
47
+
48
+ For older viewers that require native audio, explicitly set
49
+ `source_timeline_only=False`; the omitted profile then resolves to
50
+ `RtcSourcePlaybackProfile.UNSPECIFIED`/0. An explicit `source_playback_profile=0`
51
+ with source-only enabled preserves the earlier source-only contract. `None`
52
+ selects the profile from `source_timeline_only`; booleans and unknown profile
53
+ values are rejected. Burst with source-only disabled is invalid.
54
+
55
+ This changes the default for Agora publishers and requires a compatible server
56
+ and viewer SDK. The publisher handshake cannot discover or upgrade room viewers.
57
+ An incompatible server fails explicitly rather than silently falling back. Use a
58
+ Web SDK build with automatic profile detection, or explicitly configure
59
+ `agora.sourcePlaybackProfile: "bounded-burst-v1"` on Web SDK 1.0.0-beta.6.
60
+ Upgrading the publisher alone does not upgrade existing viewers.
58
61
 
59
62
  ### Pause / resume (egress mode)
60
63
 
@@ -94,6 +97,13 @@ implements the server's WebSocket close-code contract (40xx: don't retry,
94
97
 
95
98
  ## What's new
96
99
 
100
+ - 0.4.0: **Behaviour change** — the Agora publisher default is now source-timeline-only
101
+ playback with the bounded burst profile: a plain `AgoraEgressConfig(channel_name=..., token=..., uid=...)`
102
+ requests `source_timeline_only=True` and `BOUNDED_BURST_V1`. Viewers need a Web SDK with
103
+ automatic profile detection (1.0.0-beta.7+), or must set
104
+ `agora.sourcePlaybackProfile: 'bounded-burst-v1'` explicitly on 1.0.0-beta.6. Pass
105
+ `source_timeline_only=False` for compatibility mode (older/native-audio viewers); the
106
+ omitted profile then resolves to zero. Server capability checks remain mandatory.
97
107
  - 0.3.0: Agora source playback negotiation. `AgoraEgressConfig(source_timeline_only=True)`
98
108
  requests source-timeline-only playback; `source_playback_profile=RtcSourcePlaybackProfile.BOUNDED_BURST_V1`
99
109
  requests the bounded source playback profile. `start()` refuses the session
@@ -13,7 +13,7 @@ from .proto.generated import message_pb2
13
13
 
14
14
 
15
15
  class RtcSourcePlaybackProfile(IntEnum):
16
- """Explicit source playback contract; independent RTC viewers must also opt in."""
16
+ """Source playback contract; current Web SDK viewers detect it automatically."""
17
17
 
18
18
  UNSPECIFIED = message_pb2.RTC_SOURCE_PLAYBACK_PROFILE_UNSPECIFIED
19
19
  BOUNDED_BURST_V1 = message_pb2.RTC_SOURCE_PLAYBACK_PROFILE_BOUNDED_BURST_V1
@@ -60,14 +60,22 @@ class AgoraEgressConfig:
60
60
  token: str = field(default="", repr=False)
61
61
  uid: int = 0
62
62
  publisher_id: str = ""
63
- # Only for viewers that play source-timeline audio and manage entry locally.
64
- # The server must explicitly acknowledge this mode during the handshake.
65
- source_timeline_only: bool = False
66
- source_playback_profile: RtcSourcePlaybackProfile = RtcSourcePlaybackProfile.UNSPECIFIED
63
+ # Current viewers play source-timeline audio and manage entry locally.
64
+ # The server must explicitly acknowledge both capabilities before start.
65
+ # Set source_timeline_only=False for legacy/native-audio viewers.
66
+ source_timeline_only: bool = True
67
+ # None selects burst with source-only, otherwise the compatibility profile.
68
+ source_playback_profile: RtcSourcePlaybackProfile | None = None
67
69
 
68
70
  def __post_init__(self) -> None:
69
71
  if not isinstance(self.source_timeline_only, bool):
70
72
  raise ValueError("source_timeline_only must be a boolean")
73
+ if self.source_playback_profile is None:
74
+ self.source_playback_profile = (
75
+ RtcSourcePlaybackProfile.BOUNDED_BURST_V1
76
+ if self.source_timeline_only
77
+ else RtcSourcePlaybackProfile.UNSPECIFIED
78
+ )
71
79
  if isinstance(self.source_playback_profile, bool) or not isinstance(self.source_playback_profile, int):
72
80
  raise ValueError("source_playback_profile must be a known RtcSourcePlaybackProfile")
73
81
  try:
@@ -0,0 +1 @@
1
+ __version__ = "0.4.0"
@@ -1 +0,0 @@
1
- __version__ = "0.3.0"
File without changes
File without changes
File without changes