Search code examples
botsbotframeworkmicrosoft-teams

bot sending an mp3 (or wav) to a user in MS teams


I am building an MS Teams bot. According to this sample, botbuilder framework supports audio, but when I actually try to do it in MS Teams it doesn't work, in that it shows the following:

audio card

Here is my code:

  async def send_audio(self, audio):
    logger.debug(f"Sending {audio}")
    card = AudioCard(
      title="",
      media=[MediaUrl(url=audio)],
    )
    await turn_context.send_activity(MessageFactory.attachment(CardFactory.audio_card(card)))

inspired by:

https://github.com/microsoft/BotBuilder-Samples/blob/main/samples/python/06.using-cards/dialogs/main_dialog.py

How can I send audio from my bot to a user? A working sample would be best, but please don't point me to MS Documentation (It is total crap!)


Solution

  • The following cards are implemented by the Bot Framework, but are not supported by Teams:

    1. Animation cards
    2. Audio cards
    3. Video cards

    Ref: https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-reference#cards-not-supported-in-teams