Skip to content

[BUG] Type is not msgpack serializable: TTSRequest #5

Closed
@talongao

Description

@talongao

I am encountering issues while attempting to use the SDK for Text-to-Speech (TTS). Despite following the provided documentation and examples, I am unable to successfully generate speech from text.

Steps to Reproduce:

  1. Setup Environment:

    • Operating System: Ubuntu 20.04
    • SDK Version: 2024.10.22
    • Programming Language: Python 3.10.15
  2. Code Snippet:

from fish_audio_sdk import Session, TTSRequest

def main():
    f = None
    if result_path is not None:
        f = open(result_path, "wb")
    for chunk in self.session.tts(
        TTSRequest(text=text, reference_id=voice_id, format=audio_format)
    ):
        if f is not None:
            f.write(chunk)
            f.flush()
        elif result_array is not None:
            result_array.extend(chunk)

if __name__ == "__main__":
    main()
  1. Expected Behavior:
  • The SDK should successfully synthesize the provided text into speech and return an audio stream.
  1. Actual Behavior:
  • raise Exception: TypeError('Type is not msgpack serializable: TTSRequest')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions