@Override
	public void process(FileSource file) {
		// TODO Auto-generated method stub
		byte[] pop = file.pop(44);
		
		//Keep same header, will modify the sample rate later
		setNewSamples(pop);
		
		byte[] headerWav = Arrays.copyOfRange(pop, 8, 12);
		int wave = byteArrayToInt(headerWav);
		byte[] headerAudioFormat = Arrays.copyOfRange(pop, 20, 22);
		int audioFormat = byteToInt(headerAudioFormat);
		byte[] headerChannels = Arrays.copyOfRange(pop, 22, 24);
		int channel = byteToInt(headerChannels);
		byte[] headerSampleRate = Arrays.copyOfRange(pop, 24, 28);
		int sampleRate = byteArrayToInt(headerSampleRate);
		byte[] headerBits = Arrays.copyOfRange(pop, 34, 36);
		int bits = byteToInt(headerBits);
		if(checkWave(wave, audioFormat, channel, sampleRate, bits)){
			
			pop = file.pop(1000);
			if(channels == 2){
				while (pop != null) {
					for (int i = 0; i < pop.length; i+=20){
						byte[] sampleByteRight1 = Arrays.copyOfRange(pop, i, i+2);
						byte[] sampleByteRight2 = Arrays.copyOfRange(pop, i+8, i+10);
						byte[] sampleByteLeft1 = Arrays.copyOfRange(pop, i, i+2);
						byte[] sampleByteLeft2 = Arrays.copyOfRange(pop, i+8, i+10);
						int sampleLeft1 = byteToInt(sampleByteLeft1);
						int sampleLeft2 = byteToInt(sampleByteLeft2);
						int sampleRight1 = byteToInt(sampleByteRight1);
						int sampleRight2 = byteToInt(sampleByteRight2);
					}
					pop = file.pop(1000);
				}
			}
			else
				if(channels == 1){
					while (pop != null){
						for (int i = 0; i < pop.length; i+=10){
							byte[] sampleByte1 = Arrays.copyOfRange(pop, i, i+2);
							byte[] sampleByte2 = Arrays.copyOfRange(pop, i + 8, i+10);
							int sample1 = byteToInt(sampleByte1);
							int sample2 = byteToInt(sampleByte2);
							int mid = (sample1 + sample2 / 2);
							System.out.println(mid);
						}
						pop = file.pop(1000);
					}
				}
			
			
		}
		else {
			System.out.print("File is not valid");
		}
//		for(int i = 0; i < pop.length; i++){
//			System.out.println(pop[i]);
//		}
		
	}