You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtorchimporttorchaudiofromtorchaudio.ioimportStreamWriter### Minimal reproducible example# Initialise StreamWriterstream=StreamWriter("test.wav")
stream.add_audio_stream(44100, 2)
# Create random stereo waveformnoise=torch.rand(441000)
waveform= []
forwaveinnoise:
waveform.append(torch.tensor((0.0, 0)))
waveform.append(torch.tensor((wave, 1)))
# Write waveform in chunks, as you would do this in a real applicationwithstream.open() asf:
print("Opened stream")
print(len(waveform))
foriinrange(0, len(waveform), 4):
print((waveform[i], waveform[i+1], waveform[i+2], waveform[i+3]))
f.write_audio_chunk(0, torch.stack((waveform[i], waveform[i+1], waveform[i+2], waveform[i+3])))
print("Done")
Produces weird output files, such as:
The second channel always repeats the same pattern, creating a humming noise. The first channel seems to work fine if you replace 0.0 with wave. In the example shown above, though, it seems to contain the second channel's output. StreamWriter works well if the whole waveform is supplied, without writing it in chunks, as done in the documentation.
Versions
Collecting environment information...
PyTorch version: 2.4.0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: macOS 15.0 (arm64)
GCC version: Could not collect
Clang version: 15.0.0 (clang-1500.3.9.4)
CMake version: Could not collect
Libc version: N/A
Python version: 3.12.1 | packaged by Anaconda, Inc. | (main, Jan 19 2024, 09:45:58) [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-15.0-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Apple M2
Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] torch==2.4.0
[pip3] torch-tb-profiler==0.4.3
[pip3] torchaudio==2.4.0
[pip3] torchvision==0.19.0
[conda] libopenvino-pytorch-frontend 2023.3.0 hebf3989_2 conda-forge
[conda] numpy 1.26.4 pypi_0 pypi
[conda] torch 2.4.0 pypi_0 pypi
[conda] torch-tb-profiler 0.4.3 pypi_0 pypi
[conda] torchaudio 2.4.0 pypi_0 pypi
[conda] torchvision 0.19.0 pypi_0 pypi
The text was updated successfully, but these errors were encountered:
🐛 Describe the bug
Produces weird output files, such as:
The second channel always repeats the same pattern, creating a humming noise. The first channel seems to work fine if you replace
0.0
withwave
. In the example shown above, though, it seems to contain the second channel's output.StreamWriter
works well if the whole waveform is supplied, without writing it in chunks, as done in the documentation.Versions
The text was updated successfully, but these errors were encountered: