Skip to content

Commit f3a1f82

Browse files
author
Sam Anklesaria
committed
Use torchcodec url streaming
1 parent b2b5f40 commit f3a1f82

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/tutorials/audio_io_tutorial.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ def plot_specgram(waveform, sample_rate, title="Spectrogram"):
235235

236236
# Load audio data as HTTP request
237237
url = "https://download.pytorch.org/torchaudio/tutorial-assets/Lab41-SRI-VOiCES-src-sp0307-ch127535-sg0042.wav"
238-
with requests.get(url, stream=False) as response:
239-
waveform, sample_rate = load_torchcodec(response.content)
238+
waveform, sample_rate = load_torchcodec(url)
240239
plot_specgram(waveform, sample_rate, title="HTTP datasource")
241240

242241
######################################################################

0 commit comments

Comments
 (0)