Skip to content

SpeechSDK and MusicSDK lack audio file save capability #146

@NianJiuZst

Description

@NianJiuZst

Summary

SpeechSDK.synthesize() and MusicSDK.generate() return hex-encoded audio in response.data.audio, but provide no method to decode and save that audio to disk. Users must manually implement hex validation, decoding, directory creation, and default filename generation.

The CLI already handles all of this via saveAudioOutput() in src/output/audio.ts.

Proposed solution

Add save(response, outPath?, ext?) methods to both SDKs that:

  • Validate hex format and length
  • Decode via Buffer.from(hex, 'hex')
  • Create intermediate directories
  • Generate timestamp-based default filenames
  • Throw on missing audio data or disk-full errors

See linked PR.

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