Skip to content

Conversation

lobster-mane
Copy link

This merge request introduces two new features for the audio tools:

  1. Batch Size Argument for EmptyLatentAudio:
    This feature allows users to specify the batch size when creating empty latent audio with the EmptyLatentAudio node. Can be used for making one-shot (drum) samples.

  2. WAV File Format Option for SaveAudio:
    A new option to save audio files in WAV format has been added to the SaveAudio node. This change enables users to save audio files in the widely used WAV format, making integration with other audio tools easier, instead of relying only on FLAC.

Changes

  • Added a batch_size argument to the EmptyLatentAudio node.
  • Updated the SaveAudio node to support saving audio files in WAV format.

Benefits

  • Improved flexibility and scalability:
    The batch size argument allows users to create larger batch sizes to be used to create one-shot samples or more variations.

  • Broader file format support:
    The WAV format is commonly used in many audio processing workflows and has better support in DAWs. Adding support for it helps increase compatibility with various applications and use cases.

Testing

  • Both features have been tested to ensure they work as expected, and no existing functionality was affected.

Please review and let me know if any additional changes are needed. Thank you!

@comfyanonymous
Copy link
Owner

Adding batch size is good but I think the wav saving should be a different node because different file formats can have different options.

torchaudio.save(buff, waveform, audio["sample_rate"], format=file_format)

buff = insert_or_replace_vorbis_comment(buff, metadata)
if (file_format == "flac"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python code shouldn't have () parens here

@mcmonkey4eva
Copy link
Contributor

Could you please separate the two parts of this PR into two separate PRs?

@mcmonkey4eva mcmonkey4eva added User Support A user needs help with something, probably not a bug. and removed User Support A user needs help with something, probably not a bug. labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants