To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

The primary repository for this project is hosted at https://github.com/Codasign/york-software-bootcamp-audio-day.git .
This repository is a read-only copy which is updated automatically every hour.

Statistics Download as Zip
| Branch: | Revision:

root / 1-wavread.py @ 6:fd0f9d0615b2

History | View | Annotate | Download (615 Bytes)

1
from scikits.audiolab import wavread
2
from scikits.audiolab import play
3

    
4
# specify a file name
5
filename = "viola.wav"
6

    
7
# extract audio from file
8
samples, fs, enc = wavread(filename)     
9

    
10
# print out the first 50 samples
11
print samples[0:50]
12

    
13

    
14
#################################################
15
############# PLAYING AN AUDIO FILE #############
16
#################################################
17

    
18
# play the audio file data in 'data' at 44100Hz
19
play(samples,fs=44100)
20

    
21

    
22
#################################################
23
#################################################
24
#################################################