Skip to content

Commit 98fbd03

Browse files
committed
Remove hide_seek wrapping for torchcodec
1 parent 1c38f95 commit 98fbd03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/tutorials/audio_io_tutorial.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ def plot_specgram(waveform, sample_rate, title="Spectrogram"):
234234

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

241241
######################################################################
@@ -257,7 +257,7 @@ def plot_specgram(waveform, sample_rate, title="Spectrogram"):
257257
key = "VOiCES_devkit/source-16k/train/sp0307/Lab41-SRI-VOiCES-src-sp0307-ch127535-sg0042.wav"
258258
client = boto3.client("s3", config=Config(signature_version=UNSIGNED))
259259
response = client.get_object(Bucket=bucket, Key=key)
260-
waveform, sample_rate = load_torchcodec(_hide_seek(response["Body"]))
260+
waveform, sample_rate = load_torchcodec(response["Body"])
261261
plot_specgram(waveform, sample_rate, title="From S3")
262262

263263

0 commit comments

Comments
 (0)