I'm trying to generate a sine wave of a given frequency for a given duration and then write it into a .wav file. I'm using numpy's sin function and scipy's wavfile function. I'm getting a weird sound that is definitely not a sine wave.
import numpy as np
from scipy.io import wavfile
fs = 44100
f = int(raw_input("Enter fundamental frequency: "))
t = float(raw_input("Enter duration of signal (in seconds): "))
samples = np.arange(t * fs)
signal = np.sin(2 * np.pi * f * samples)
signal *= 32767
signal = np.int16(signal)
wavfile.write(str(raw_input("Name your audio: ")), fs, signal)
Any help would be appreciated. Have I made some fundamentally incorrect assumption about sine waves or something?