Hello, why doesn't the Python SDK trigger the `tra...
# sdk-web
w
Hello, why doesn't the Python SDK trigger the
track_muted
and
track_unmuted
event? Here is the code:
Copy code
import asyncio

from livekit import rtc

from experiments.token_service import create_sane_default_token


async def main():
    # set up room event handler
    room = rtc.Room()
    
    @room.on("track_muted")
    def on_track_muted(participant: rtc.Participant, publication: rtc.TrackPublication):
        print("track muted!!")

    @room.on("track_unmuted")
    def on_track_unmuted(participant: rtc.Participant, publication: rtc.TrackPublication):
        print("track unmuted!!")

    # connect
    tok_resp = create_sane_default_token(identity="alice", room_name="room123")
    await room.connect(url=tok_resp.livekit_url, token=tok_resp.token)
    
    # print url and token for https://meet.livekit.io/
    another_tok = create_sane_default_token(identity="browser", room_name="room123")
    print(another_tok.livekit_url)
    print(another_tok.token)

    # publish hue
    source = rtc.VideoSource(width=1280, height=720)
    track = rtc.LocalVideoTrack.create_video_track("hue", source)
    options = rtc.TrackPublishOptions(
        source=rtc.TrackSource.SOURCE_CAMERA,
        simulcast=True,
        video_encoding=rtc.VideoEncoding(
            max_bitrate=3_000_000,
            max_framerate=30,
        ),
    )
    lpublication = await room.local_participant.publish_track(track, options)
    print("hue published")

    # mute
    lpublication.track.mute()
    print("manual mute")
    await asyncio.sleep(1)
    
    # unmute
    lpublication.track.unmute()
    print("manual unmute")
    await asyncio.sleep(1)

    # wait forever
    await asyncio.Future()
    

if __name__ == "__main__":
    asyncio.run(main())
Important info: • Tried publishing wave audio and do mute/unmute via Python SDK. The https://meet.livekit.io/ mic icon does not change, telling me that the event does not fire even from the web client perspective. • Tried multiple Python SDK client (3 identities joining the same room) at the same time, nope! The track mute/unmute event still does not fire for each other • Note that when I click mute/unmute in https://meet.livekit.io/, the event DOES trigger in Python event handler. Is this a bug from Python SDK? • Also, the video/audio mute/unmute itself DOES work, but only the event that is not triggered.