File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 21
21
22
22
import torch
23
23
import torchaudio
24
+ import requests
24
25
import matplotlib .pyplot as plt
25
26
26
27
######################################################################
31
32
# call waveform the resulting raw audio signal.
32
33
#
33
34
34
- filename = "../_static/img/steam-train-whistle-daniel_simon-converted-from-mp3.wav"
35
+ url = "https://pytorch.org/tutorials/_static/img/steam-train-whistle-daniel_simon-converted-from-mp3.wav"
36
+ r = requests .get (url )
37
+
38
+ with open ('steam-train-whistle-daniel_simon-converted-from-mp3.wav' , 'wb' ) as f :
39
+ f .write (r .content )
40
+
41
+ filename = "steam-train-whistle-daniel_simon-converted-from-mp3.wav"
35
42
waveform , sample_rate = torchaudio .load (filename )
36
43
37
44
print ("Shape of waveform: {}" .format (waveform .size ()))
You can’t perform that action at this time.
0 commit comments