Skip to content

Commit

Permalink
Pushing file openFile.py intended to have functionality to open audio…
Browse files Browse the repository at this point in the history
… files and attain data from them.
  • Loading branch information
jilliennelapid committed Dec 2, 2023
0 parents commit 5b34433
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions openFile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from scipy.io import wavfile
import scipy.io

# file name would need to be read and saved to this variable
wav_fname = ""

# opens the .wav file
samplerate, data = wavfile.read(wav_fname)

print(f"number of channels = {data.shape[len(data.shape) - 1]}")
print(f"sample rate = {samplerate}Hz")

length = data.shape[0] / samplerate
print(f"length = {length}s")

0 comments on commit 5b34433

Please sign in to comment.