@@ -70,6 +70,39 @@ Other helpers:
7070- ` wearable.streams.battery_health_status() `
7171- ` wearable.streams.battery_energy_status() `
7272
73+ ### Audio Playback
74+
75+ Raw websocket-aligned methods:
76+
77+ - ` store_sound(sound_id, audio_base64, codec=None, sample_rate=None, num_channels=None, interleaved=None, buffer_size=None) `
78+ - ` play_sound(sound_id=None, url=None, volume=None, codec=None, sample_rate=None, num_channels=None) ` (exactly one of ` sound_id ` or ` url ` )
79+ - ` start_audio_stream(volume=None) `
80+ - ` push_audio_stream_chunk(audio_base64) `
81+ - ` stop_audio_stream() `
82+
83+ Python-friendly helpers:
84+
85+ - ` store_sound_bytes(sound_id, audio_bytes, codec=None, sample_rate=None, num_channels=None, interleaved=None, buffer_size=None) `
86+ - ` store_sound_file(sound_id, file_path, codec=None, sample_rate=None, num_channels=None, interleaved=None, buffer_size=None) `
87+ - ` push_audio_stream_chunk_bytes(audio_chunk) `
88+ - ` push_audio_stream_chunk_file(file_path) `
89+ - ` client.audio.store_sound(...) `
90+ - ` client.audio.store_sound_file(...) `
91+ - ` client.audio.play_sound(...) `
92+ - ` client.audio.stream(volume=...) ` (context-managed ` AudioStreamSession ` )
93+
94+ Example:
95+
96+ ``` python
97+ async with OpenWearableIPCClient(" ws://192.168.1.23:8765/ws" ) as client:
98+ await client.audio.store_sound_file(" beep_ok" , " beep.wav" )
99+ await client.audio.play_sound(" beep_ok" , volume = 1.0 )
100+ await client.audio.play_sound(url = " https://example.org/alert.wav" , volume = 0.7 )
101+
102+ async with client.audio.stream(volume = 0.8 ) as stream:
103+ await stream.push(chunk_bytes)
104+ ```
105+
73106## ` SensorDataset `
74107
75108High-level API for loading and analyzing a single ` .oe ` recording.
0 commit comments