Visit ComfyUI Online for ready-to-use ComfyUI environment
Change audio sample rate with high quality, maintaining integrity and clarity using advanced resampling techniques for seamless conversion.
The Resample Audio (HQ) node is designed to change the sample rate of audio data with high quality, ensuring that the audio maintains its integrity and clarity during the conversion process. This node is particularly useful when you need to match the sample rate of different audio files or when preparing audio for specific playback or processing requirements. By utilizing advanced resampling techniques, such as those provided by librosa, resample_poly, or torchaudio, the node offers flexibility and precision in handling audio data. The primary goal of this node is to facilitate seamless audio sample rate conversion, making it an essential tool for audio processing tasks where maintaining audio quality is crucial.
This parameter represents the audio data to be resampled. It can be provided as a NumPy array or a PyTorch tensor, with the shape either being (channel, num_samples) for multi-channel audio or (num_samples) for single-channel audio. The audio data serves as the primary input for the resampling process, and its quality and format will directly impact the output.
The origin_sr parameter specifies the original sample rate of the input audio. It is an integer value that indicates how many samples per second the audio was originally recorded or stored at. This parameter is crucial for accurately converting the audio to the desired target sample rate.
This parameter defines the target sample rate to which the audio should be resampled. Like origin_sr, it is an integer value representing the number of samples per second for the output audio. The target_sr determines the new resolution of the audio data, affecting its playback speed and quality.
The resample_module parameter allows you to choose the resampling library or method to be used. Options include 'librosa', 'resample_poly', and 'torchaudio', with 'librosa' being the default. Each option offers different algorithms and performance characteristics, allowing you to select the most suitable method for your specific needs.
This parameter specifies the type of resampling algorithm to be used when librosa is selected as the resample_module. The default value is "kaiser_fast", which is a commonly used algorithm for its balance between speed and quality. This parameter is only applicable when using librosa and allows for further customization of the resampling process.
The audio_path parameter is optional and can be used to specify the file path of the audio data. This is useful if you want to keep track of the source file or if additional metadata is required for processing. However, it is not necessary for the resampling operation itself.
The resampled_audio is the primary output of the node, representing the audio data after it has been resampled to the target sample rate. This output maintains the same format as the input, either as a NumPy array or a PyTorch tensor, and reflects the changes made during the resampling process. The quality and characteristics of this output are directly influenced by the input parameters and the chosen resampling method.
torchaudio resample module for efficient processing, especially if you are resampling multiple audio files with the same parameters.librosa module with the kaiser_fast resample type is a good choice for most applications.origin_sr and target_sr parameters are set correctly to avoid unexpected changes in audio speed or pitch.origin_sr and target_sr parameters are set to the same value, making resampling unnecessary.resample_module is not recognized or supported.resample_module is set to one of the supported options: 'librosa', 'resample_poly', or 'torchaudio'.(channel, num_samples) or (num_samples).RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.