Save Audio:
The pymss_save_audio node is designed to facilitate the saving of audio data in various formats, providing flexibility and control over the output characteristics. This node is particularly beneficial for AI artists and developers working with audio data, as it allows for the conversion and storage of audio files in formats such as WAV, FLAC, and MP3. By offering options to specify the sample rate, bit depth, and bit rate, the node ensures that the saved audio meets specific quality and size requirements. The primary goal of this node is to streamline the process of exporting audio data from the ComfyUI environment, making it accessible and usable in different contexts and applications.
Save Audio Input Parameters:
audio
This parameter represents the audio data that you wish to save. It is a required input and serves as the core content that will be processed and exported by the node. The audio data should be in a format compatible with ComfyUI's audio processing capabilities.
output_format
This parameter determines the file format in which the audio will be saved. The available options are "wav", "flac", and "mp3", with "wav" being the default. Choosing the appropriate format can impact the audio quality and file size, with WAV typically offering the highest quality and MP3 providing more compressed file sizes.
sample_rate
This parameter specifies the sample rate at which the audio will be saved. The options include "32000", "44100", and "48000", with "44100" as the default. The sample rate affects the audio's fidelity, with higher rates generally providing better sound quality.
wav_bit_depth
This parameter is relevant when saving audio in WAV format and determines the bit depth of the output file. The options are "PCM_16", "PCM_24", and "FLOAT", with "FLOAT" as the default. Higher bit depths can offer more dynamic range and detail in the audio.
flac_bit_depth
This parameter applies when saving audio in FLAC format and specifies the bit depth of the output file. The available options are "PCM_16" and "PCM_24", with "PCM_24" as the default. Similar to WAV, higher bit depths in FLAC can enhance audio quality.
mp3_bit_rate
This parameter is used when saving audio in MP3 format and defines the bit rate of the output file. The options are "128k", "192k", "256k", and "320k", with "320k" as the default. Higher bit rates generally result in better audio quality but larger file sizes.
filename
This optional parameter allows you to specify a custom filename for the saved audio file. It is a string input, and if left empty, a default naming convention will be used. Providing a specific filename can help in organizing and identifying saved audio files.
Save Audio Output Parameters:
ui
This output parameter provides a dictionary containing the paths of the saved audio files. It is essential for verifying the successful execution of the node and locating the output files within the specified directory. The saved paths can be used for further processing or sharing the audio files.
Save Audio Usage Tips:
- To ensure optimal audio quality, choose a higher sample rate and bit depth when saving in WAV or FLAC formats, especially if the audio will be used for professional purposes.
- When saving in MP3 format, consider the trade-off between file size and quality. A higher bit rate like "320k" is recommended for better sound quality, while lower bit rates can be used for smaller file sizes.
Save Audio Common Errors and Solutions:
ValueError: "audio input is required."
- Explanation: This error occurs when the audio parameter is not provided or is set to None.
- Solution: Ensure that the audio data is correctly passed to the node before execution.
ValueError: "sample rates must be positive integers."
- Explanation: This error arises if the sample rate is set to a non-positive value.
- Solution: Verify that the sample rate is set to one of the valid options: "32000", "44100", or "48000".
ValueError: "Expected ComfyUI AUDIO waveform [batch, channels, samples], got shape ..."
- Explanation: This error indicates that the audio waveform does not match the expected shape.
- Solution: Check the audio data format and ensure it adheres to the required structure before passing it to the node.
