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 20
20
21
21
import torch
22
22
import torchaudio
23
+ import requests
23
24
import matplotlib .pyplot as plt
24
25
25
26
######################################################################
30
31
# call waveform the resulting raw audio signal.
31
32
#
32
33
33
- filename = "../_static/img/steam-train-whistle-daniel_simon-converted-from-mp3.wav"
34
+ url = "https://pytorch.org/tutorials/_static/img/steam-train-whistle-daniel_simon-converted-from-mp3.wav"
35
+ r = requests .get (url )
36
+
37
+ with open ('steam-train-whistle-daniel_simon-converted-from-mp3.wav' , 'wb' ) as f :
38
+ f .write (r .content )
39
+
40
+ filename = "steam-train-whistle-daniel_simon-converted-from-mp3.wav"
34
41
waveform , sample_rate = torchaudio .load (filename )
35
42
36
43
print ("Shape of waveform: {}" .format (waveform .size ()))
You can’t perform that action at this time.
0 commit comments