Daily-python

Latest version: v0.7.4

Safety actively analyzes 622894 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

10.0

for _ in range (int(SECONDS_TO_READ / READ_INTERVAL)):
buffer = speaker.read_frames(FRAMES_TO_READ)
time.sleep(READ_INTERVAL)


can be replaced with:

python
SECONDS_TO_READ = 10
FRAMES_TO_READ = SAMPLE_RATE * SECONDS_TO_READ
buffer = speaker.read_frames(FRAMES_TO_READ)


Fixed

- Fixed an issue that was causing sporadic audio gaps on macOS and in certain OS
task scheduling scenarios.

- Network re-connections have been improved.

0.7.4

Fixed

- Fixed a crash caused by the following completion callbacks:
`CallClient.update_inputs()`, `CallClient.update_publishing()`,
`CallClient.update_subscriptions()`,
`CallClient.update_subscription_profiles()`. The signature of the functions
was wrongly documented as only a single `error` argument is passed.

- Fixed issue when calling `CallClient.update_publishing()` immediately after
`CallClient.update_inputs()`.

0.7.3

Fixed

- Fixed an issue that could cause video and audio renderers not to work if they
were registered after the media track was already being received.

0.7.2

Fixed

- Fixed missing milliseconds in client logs timestamps.

0.7.1

Fixed

- Fixed an issue that could cause join to fail if recording/transcription/live
stream was started from the REST API.

0.7.0

Added

- Added initial support for low-level Voice Activity Detection (VAD).

python
vad = Daily.create_native_vad(1000, 16000, 1)
confidence = vad.analyze_frames(audio_frames)


- Added `includeRawResponse` field to `TranscriptionSettings`. If true, all
incoming `TranscriptionMessage` will include a new `rawResponse` field with
Deepgram's raw data.

- Added new `CallClient.release()` function to allow freeing resources even in
the event of `EventHandler` circular dependencies. It is common to have the
following code:

python
class MyClient(EventHandler):

def __init__(self):
self.call_client=CallClient(event_handler=self)

...


If `MyClient` is a single application there shouldn't be any issues with
freeing resources when the application ends. However, if we have an
application that wants to create and release multiple `CallClient` instances
the previous approach won't work with Python's garbage collection since
there's a circular dependency. To solve this, we can now do:


python
class MyClient(EventHandler):

def __init__(self):
self.call_client=CallClient(event_handler=self)

def leave(self):
self.call_client.leave()
self.call_client.release()

...


The new `CallClient.release()` function also blocks until all previous
asynchronous operations have completed, so it's another convenient way to
know, for example, when `CallClient.leave()` finishes.

Changed

- ⚠️ Breaking change ⚠️: Completion callbacks now receive only the necessary
arguments. For example, before `CallClient.leave(completion=...)` completion
callback would receive `(None, Error | None)` arguments when it should only
receive `(Error | None)`.

This is the list of functions with completion callbacks that have been
affected:
`CallClient.leave()`, `CallClient.update_remote_participants()`,
`CallClient.eject_remote_participants()`, `CallClient.update_permissions()`,
`CallClient.start_recording()`, `CallClient.stop_recording()`,
`CallClient.update_recording()`, `CallClient.start_transcription()`,
`CallClient.stop_transcription()`, `CallClient.start_dialout()`,
`CallClient.stop_dialout()`, `CallClient.send_app_message()`,
`CallClient.send_prebuilt_chat_message()`.

If you use any of the completion callbacks from one of the functions listed
above, you simply need to remove the first argument from your callable.

Other

- Updated demos to use the new `CallClient.release()` function.

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.