diff --git a/setup.py b/setup.py
index eee03d9..d0cd01c 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ if __name__ == "__main__":
     setup(
         name='sox',
 
-        version='1.2.1',
+        version='1.2.2',
 
         description='Python wrapper around SoX.',
 
diff --git a/sox/core.py b/sox/core.py
index 2b14d01..64a70cd 100644
--- a/sox/core.py
+++ b/sox/core.py
@@ -67,7 +67,6 @@ def sox(args):
 class SoxError(Exception):
     '''Exception to be raised when SoX exits with non-zero status.
     '''
-
     def __init__(self, *args, **kwargs):
         Exception.__init__(self, *args, **kwargs)
 
diff --git a/sox/transform.py b/sox/transform.py
index 438a3c3..f4eb248 100644
--- a/sox/transform.py
+++ b/sox/transform.py
@@ -395,6 +395,11 @@ class Transformer(object):
         file_info.validate_input_file(input_filepath)
         file_info.validate_output_file(output_filepath)
 
+        if input_filepath == output_filepath:
+            raise ValueError(
+                "input_filepath must be different from output_filepath."
+            )
+
         args = []
         args.extend(self.globals)
         args.extend(self.input_format)

diff --git a/tests/test_transform.py b/tests/test_transform.py
index aa357d1..056676c 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -386,6 +386,10 @@ class TestTransformerBuild(unittest.TestCase):
         with self.assertRaises(IOError):
             self.tfm.build('blah/asdf.wav', OUTPUT_FILE)
 
+    def test_input_output_equal(self):
+        with self.assertRaises(ValueError):
+            self.tfm.build(INPUT_FILE, INPUT_FILE)
+
     def test_failed_sox(self):
         self.tfm.effects = ['channels', '-1']
         with self.assertRaises(SoxError):

Support using same file path for input & output
Sox doesn't support using the same file as both input and output - doing this will result in an empty, invalid audio file. While this is sox behavior and not pysox, it would be nice if pysox took care of this behind the scenes. Right now the user needs to worry about this logic themselves, e.g. like this:

```python
import tempfile
import shutil
from scaper.util import _close_temp_files

audio_infile = '/Users/justin/Downloads/trimtest.wav'
audio_outfile = '/Users/justin/Downloads/trimtest.wav'
start_time = 2
end_time = 3

tfm = sox.Transformer()
tfm.trim(start_time, end_time)
if audio_outfile != audio_infile:
    tfm.build(audio_infile, audio_outfile)
else:
    # must use temp file in order to save to same file
    tmpfiles = []
    with _close_temp_files(tmpfiles):
        # Create tmp file
        tmpfiles.append(
            tempfile.NamedTemporaryFile(
                suffix='.wav', delete=True))
        # Save trimmed result to temp file
        tfm.build(audio_infile, tmpfiles[-1].name)
        # Copy result back to original file
        shutil.copyfile(tmpfiles[-1].name, audio_outfile)
```

Pysox *does* issue a warning when a file is about to be overwritten, which is even more confusing under this scenario since the user (who might be unfamiliar with the quirks of sox) has no reason to think that the overwritten file will be invalid.
tests/test_transform.py::TestTransformerBuild::test_input_output_equal
tests/test_transform.py::TestTransformDefault::test_effects tests/test_transform.py::TestTransformDefault::test_effects_log tests/test_transform.py::TestTransformDefault::test_globals tests/test_transform.py::TestTransformDefault::test_input_format tests/test_transform.py::TestTransformDefault::test_output_format tests/test_transform.py::TestTransformSetGlobals::test_dither_invalid tests/test_transform.py::TestTransformSetGlobals::test_guard_invalid tests/test_transform.py::TestTransformSetGlobals::test_multithread_invalid tests/test_transform.py::TestTransformSetGlobals::test_replay_gain_invalid tests/test_transform.py::TestTransformSetGlobals::test_verbosity_invalid tests/test_transform.py::TestTransformSetInputFormat::test_bits_invalid tests/test_transform.py::TestTransformSetInputFormat::test_bits_invalid2 tests/test_transform.py::TestTransformSetInputFormat::test_channels_invalid tests/test_transform.py::TestTransformSetInputFormat::test_channels_invalid2 tests/test_transform.py::TestTransformSetInputFormat::test_encoding_invalid tests/test_transform.py::TestTransformSetInputFormat::test_file_type_invalid tests/test_transform.py::TestTransformSetInputFormat::test_ignore_length_invalid tests/test_transform.py::TestTransformSetInputFormat::test_rate_invalid tests/test_transform.py::TestTransformSetInputFormat::test_rate_invalid2 tests/test_transform.py::TestTransformSetOutputFormat::test_append_comments_invalid tests/test_transform.py::TestTransformSetOutputFormat::test_bits_invalid tests/test_transform.py::TestTransformSetOutputFormat::test_bits_invalid2 tests/test_transform.py::TestTransformSetOutputFormat::test_channels_invalid tests/test_transform.py::TestTransformSetOutputFormat::test_channels_invalid2 tests/test_transform.py::TestTransformSetOutputFormat::test_comments_invalid tests/test_transform.py::TestTransformSetOutputFormat::test_encoding_invalid tests/test_transform.py::TestTransformSetOutputFormat::test_file_type_invalid tests/test_transform.py::TestTransformSetOutputFormat::test_rate_invalid tests/test_transform.py::TestTransformSetOutputFormat::test_rate_invalid2 tests/test_transform.py::TestTransformerBuild::test_failed_sox tests/test_transform.py::TestTransformerBuild::test_invalid tests/test_transform.py::TestTransformerPreview::test_valid tests/test_transform.py::TestTransformerAllpass::test_frequency_invalid tests/test_transform.py::TestTransformerAllpass::test_width_q_invalid tests/test_transform.py::TestTransformerBandpass::test_constant_skirt_invalid tests/test_transform.py::TestTransformerBandpass::test_frequency_invalid tests/test_transform.py::TestTransformerBandpass::test_width_q_invalid tests/test_transform.py::TestTransformerBandreject::test_frequency_invalid tests/test_transform.py::TestTransformerBandreject::test_width_q_invalid tests/test_transform.py::TestTransformerBass::test_frequency_invalid tests/test_transform.py::TestTransformerBass::test_gain_db_invalid tests/test_transform.py::TestTransformerBass::test_slope_invalid tests/test_transform.py::TestTransformerBend::test_cents_invalid_len tests/test_transform.py::TestTransformerBend::test_cents_invalid_nonlist tests/test_transform.py::TestTransformerBend::test_cents_invalid_vals tests/test_transform.py::TestTransformerBend::test_end_times_invalid_len tests/test_transform.py::TestTransformerBend::test_end_times_invalid_nonlist tests/test_transform.py::TestTransformerBend::test_end_times_invalid_order tests/test_transform.py::TestTransformerBend::test_end_times_invalid_vals tests/test_transform.py::TestTransformerBend::test_frame_rate_invalid tests/test_transform.py::TestTransformerBend::test_n_bends_invalid tests/test_transform.py::TestTransformerBend::test_overlapping_intervals tests/test_transform.py::TestTransformerBend::test_oversample_rate_invalid tests/test_transform.py::TestTransformerBend::test_start_greater_end tests/test_transform.py::TestTransformerBend::test_start_times_invalid_len tests/test_transform.py::TestTransformerBend::test_start_times_invalid_nonlist tests/test_transform.py::TestTransformerBend::test_start_times_invalid_order tests/test_transform.py::TestTransformerBend::test_start_times_invalid_vals tests/test_transform.py::TestTransformerBiquad::test_a_non_num tests/test_transform.py::TestTransformerBiquad::test_a_nonlist tests/test_transform.py::TestTransformerBiquad::test_a_wrong_len tests/test_transform.py::TestTransformerBiquad::test_b_non_num tests/test_transform.py::TestTransformerBiquad::test_b_nonlist tests/test_transform.py::TestTransformerBiquad::test_b_wrong_len tests/test_transform.py::TestTransformerChannels::test_invalid_nchannels tests/test_transform.py::TestTransformerChorus::test_invalid_decays tests/test_transform.py::TestTransformerChorus::test_invalid_decays_vals tests/test_transform.py::TestTransformerChorus::test_invalid_decays_wronglen tests/test_transform.py::TestTransformerChorus::test_invalid_delays tests/test_transform.py::TestTransformerChorus::test_invalid_delays_vals tests/test_transform.py::TestTransformerChorus::test_invalid_delays_wronglen tests/test_transform.py::TestTransformerChorus::test_invalid_depths tests/test_transform.py::TestTransformerChorus::test_invalid_depths_vals tests/test_transform.py::TestTransformerChorus::test_invalid_depths_wronglen tests/test_transform.py::TestTransformerChorus::test_invalid_gain_in tests/test_transform.py::TestTransformerChorus::test_invalid_gain_out tests/test_transform.py::TestTransformerChorus::test_invalid_n_voices tests/test_transform.py::TestTransformerChorus::test_invalid_shapes tests/test_transform.py::TestTransformerChorus::test_invalid_shapes_vals tests/test_transform.py::TestTransformerChorus::test_invalid_shapes_wronglen tests/test_transform.py::TestTransformerChorus::test_invalid_speeds tests/test_transform.py::TestTransformerChorus::test_invalid_speeds_vals tests/test_transform.py::TestTransformerChorus::test_invalid_speeds_wronglen tests/test_transform.py::TestTransformerContrast::test_invalid_amount_big tests/test_transform.py::TestTransformerContrast::test_invalid_amount_neg tests/test_transform.py::TestTransformerContrast::test_invalid_amount_nonnum tests/test_transform.py::TestTransformerCompand::test_attack_time_invalid_neg tests/test_transform.py::TestTransformerCompand::test_attack_time_invalid_nonnum tests/test_transform.py::TestTransformerCompand::test_decay_time_invalid_neg tests/test_transform.py::TestTransformerCompand::test_decay_time_invalid_nonnum tests/test_transform.py::TestTransformerCompand::test_soft_knee_invalid tests/test_transform.py::TestTransformerCompand::test_tf_points_empty tests/test_transform.py::TestTransformerCompand::test_tf_points_nonlist tests/test_transform.py::TestTransformerCompand::test_tf_points_nontuples tests/test_transform.py::TestTransformerCompand::test_tf_points_tup_dups tests/test_transform.py::TestTransformerCompand::test_tf_points_tup_len tests/test_transform.py::TestTransformerCompand::test_tf_points_tup_nonnum tests/test_transform.py::TestTransformerCompand::test_tf_points_tup_nonnum2 tests/test_transform.py::TestTransformerCompand::test_tf_points_tup_positive tests/test_transform.py::TestTransformerConvert::test_bitdepth_invalid tests/test_transform.py::TestTransformerConvert::test_channels_invalid1 tests/test_transform.py::TestTransformerConvert::test_channels_invalid2 tests/test_transform.py::TestTransformerConvert::test_samplerate_invalid tests/test_transform.py::TestTransformerDcshift::test_invalid_shift_big tests/test_transform.py::TestTransformerDcshift::test_invalid_shift_neg tests/test_transform.py::TestTransformerDcshift::test_invalid_shift_nonnum tests/test_transform.py::TestTransformerDelay::test_invalid_position_type tests/test_transform.py::TestTransformerDelay::test_invalid_position_vals tests/test_transform.py::TestTransformerDownsample::test_default tests/test_transform.py::TestTransformerDownsample::test_invalid_factor_neg tests/test_transform.py::TestTransformerDownsample::test_invalid_factor_nonnum tests/test_transform.py::TestTransformerEcho::test_decays_invalid_len tests/test_transform.py::TestTransformerEcho::test_decays_invalid_type tests/test_transform.py::TestTransformerEcho::test_decays_invalid_vals tests/test_transform.py::TestTransformerEcho::test_delays_invalid_len tests/test_transform.py::TestTransformerEcho::test_delays_invalid_type tests/test_transform.py::TestTransformerEcho::test_delays_invalid_vals tests/test_transform.py::TestTransformerEcho::test_gain_in_invalid tests/test_transform.py::TestTransformerEcho::test_gain_out_invalid tests/test_transform.py::TestTransformerEcho::test_n_echos_invalid tests/test_transform.py::TestTransformerEchos::test_decays_invalid_len tests/test_transform.py::TestTransformerEchos::test_decays_invalid_type tests/test_transform.py::TestTransformerEchos::test_decays_invalid_vals tests/test_transform.py::TestTransformerEchos::test_delays_invalid_len tests/test_transform.py::TestTransformerEchos::test_delays_invalid_type tests/test_transform.py::TestTransformerEchos::test_delays_invalid_vals tests/test_transform.py::TestTransformerEchos::test_gain_in_invalid tests/test_transform.py::TestTransformerEchos::test_gain_out_invalid tests/test_transform.py::TestTransformerEchos::test_n_echos_invalid tests/test_transform.py::TestTransformerEqualizer::test_frequency_invalid tests/test_transform.py::TestTransformerEqualizer::test_gain_db_invalid tests/test_transform.py::TestTransformerEqualizer::test_width_q_invalid tests/test_transform.py::TestTransformerFade::test_fade_in_invalid tests/test_transform.py::TestTransformerFade::test_fade_out_invalid tests/test_transform.py::TestTransformerFade::test_fade_shape_invalid tests/test_transform.py::TestTransformerFir::test_invalid_coeffs_nonlist tests/test_transform.py::TestTransformerFir::test_invalid_coeffs_vals tests/test_transform.py::TestTransformerFlanger::test_flanger_delay_invalid tests/test_transform.py::TestTransformerFlanger::test_flanger_depth_invalid tests/test_transform.py::TestTransformerFlanger::test_flanger_interp_invalid tests/test_transform.py::TestTransformerFlanger::test_flanger_phase_invalid tests/test_transform.py::TestTransformerFlanger::test_flanger_regen_invalid tests/test_transform.py::TestTransformerFlanger::test_flanger_shape_invalid tests/test_transform.py::TestTransformerFlanger::test_flanger_speed_invalid tests/test_transform.py::TestTransformerFlanger::test_flanger_width_invalid tests/test_transform.py::TestTransformerGain::test_balance_invalid tests/test_transform.py::TestTransformerGain::test_gain_db_invalid tests/test_transform.py::TestTransformerGain::test_limiter_invalid tests/test_transform.py::TestTransformerGain::test_normalize_invalid tests/test_transform.py::TestTransformerHighpass::test_frequency_invalid tests/test_transform.py::TestTransformerHighpass::test_n_poles_invalid tests/test_transform.py::TestTransformerHighpass::test_width_q_invalid tests/test_transform.py::TestTransformerHilbert::test_default tests/test_transform.py::TestTransformerHilbert::test_num_taps_invalid tests/test_transform.py::TestTransformerHilbert::test_num_taps_invalid_even tests/test_transform.py::TestTransformerHilbert::test_num_taps_valid tests/test_transform.py::TestTransformerLowpass::test_frequency_invalid tests/test_transform.py::TestTransformerLowpass::test_n_poles_invalid tests/test_transform.py::TestTransformerLowpass::test_width_q_invalid tests/test_transform.py::TestTransformerLoudness::test_gain_db_invalid tests/test_transform.py::TestTransformerLoudness::test_reference_level_invalid tests/test_transform.py::TestTransformerLoudness::test_reference_level_oorange tests/test_transform.py::TestTransformerMcompand::test_attack_time_invalid_len tests/test_transform.py::TestTransformerMcompand::test_attack_time_invalid_neg tests/test_transform.py::TestTransformerMcompand::test_attack_time_invalid_nonnum tests/test_transform.py::TestTransformerMcompand::test_attack_time_invalid_type tests/test_transform.py::TestTransformerMcompand::test_crossover_frequencies_invalid tests/test_transform.py::TestTransformerMcompand::test_crossover_frequencies_invalid_vals tests/test_transform.py::TestTransformerMcompand::test_decay_time_invalid_len tests/test_transform.py::TestTransformerMcompand::test_decay_time_invalid_neg tests/test_transform.py::TestTransformerMcompand::test_decay_time_invalid_nonnum tests/test_transform.py::TestTransformerMcompand::test_decay_time_invalid_type tests/test_transform.py::TestTransformerMcompand::test_n_bands_invalid tests/test_transform.py::TestTransformerMcompand::test_soft_knee_db_invalid_len tests/test_transform.py::TestTransformerMcompand::test_soft_knee_db_invalid_type tests/test_transform.py::TestTransformerMcompand::test_soft_knee_invalid tests/test_transform.py::TestTransformerMcompand::test_tf_points_elt_empty tests/test_transform.py::TestTransformerMcompand::test_tf_points_elt_nonlist tests/test_transform.py::TestTransformerMcompand::test_tf_points_elt_nontuples tests/test_transform.py::TestTransformerMcompand::test_tf_points_elt_tup_len tests/test_transform.py::TestTransformerMcompand::test_tf_points_elt_tup_nonnum tests/test_transform.py::TestTransformerMcompand::test_tf_points_tup_dups tests/test_transform.py::TestTransformerMcompand::test_tf_points_tup_nonnum2 tests/test_transform.py::TestTransformerMcompand::test_tf_points_tup_positive tests/test_transform.py::TestTransformerMcompand::test_tf_points_wrong_len tests/test_transform.py::TestTransformerNorm::test_db_level_invalid tests/test_transform.py::TestTransformerOverdrive::test_colour_invalid tests/test_transform.py::TestTransformerOverdrive::test_gain_db_invalid tests/test_transform.py::TestTransformerPad::test_end_duration_invalid tests/test_transform.py::TestTransformerPad::test_start_duration_invalid tests/test_transform.py::TestTransformerPhaser::test_decay_invalid tests/test_transform.py::TestTransformerPhaser::test_delay_invalid tests/test_transform.py::TestTransformerPhaser::test_gain_in_invalid tests/test_transform.py::TestTransformerPhaser::test_gain_out_invalid tests/test_transform.py::TestTransformerPhaser::test_modulation_shape_invalid tests/test_transform.py::TestTransformerPhaser::test_speed_invalid tests/test_transform.py::TestTransformerPitch::test_n_semitones_invalid tests/test_transform.py::TestTransformerPitch::test_quick_invalid tests/test_transform.py::TestTransformerRate::test_quality_invalid tests/test_transform.py::TestTransformerRate::test_samplerate_invalid tests/test_transform.py::TestTransformerRepeat::test_count_invalid tests/test_transform.py::TestTransformerRepeat::test_count_invalid_fmt tests/test_transform.py::TestTransformerReverb::test_high_freq_damping_invalid tests/test_transform.py::TestTransformerReverb::test_pre_delay_invalid tests/test_transform.py::TestTransformerReverb::test_reverberance_invalid tests/test_transform.py::TestTransformerReverb::test_room_scale_invalid tests/test_transform.py::TestTransformerReverb::test_stereo_depth_invalid tests/test_transform.py::TestTransformerReverb::test_wet_gain_invalid tests/test_transform.py::TestTransformerReverb::test_wet_only_invalid tests/test_transform.py::TestTransformerSilence::test_buffer_around_silence_invalid tests/test_transform.py::TestTransformerSilence::test_location_invalid tests/test_transform.py::TestTransformerSilence::test_min_silence_duration_invalid tests/test_transform.py::TestTransformerSilence::test_silence_threshold_invalid tests/test_transform.py::TestTransformerSilence::test_silence_threshold_invalid2 tests/test_transform.py::TestTransformerSinc::test_cutoff_freq_invalid tests/test_transform.py::TestTransformerSinc::test_cutoff_freq_invalid_high tests/test_transform.py::TestTransformerSinc::test_cutoff_freq_invalid_list tests/test_transform.py::TestTransformerSinc::test_cutoff_freq_invalid_list_len tests/test_transform.py::TestTransformerSinc::test_cutoff_freq_invalid_number tests/test_transform.py::TestTransformerSinc::test_cutoff_freq_invalid_reject tests/test_transform.py::TestTransformerSinc::test_filter_type_invalid tests/test_transform.py::TestTransformerSinc::test_phase_response_invalid tests/test_transform.py::TestTransformerSinc::test_phase_response_invalid_large tests/test_transform.py::TestTransformerSinc::test_phase_response_invalid_small tests/test_transform.py::TestTransformerSinc::test_stop_band_attenuation_invalid tests/test_transform.py::TestTransformerSinc::test_transition_bw_invalid tests/test_transform.py::TestTransformerSinc::test_transition_bw_invalid_float tests/test_transform.py::TestTransformerSinc::test_transition_bw_invalid_list_elt tests/test_transform.py::TestTransformerSinc::test_transition_bw_invalid_low tests/test_transform.py::TestTransformerSinc::test_transition_bw_linvalid_list_len tests/test_transform.py::TestTransformerSpeed::test_factor_invalid tests/test_transform.py::TestTransformerStretch::test_factor_invalid tests/test_transform.py::TestTransformerStretch::test_window_invalid tests/test_transform.py::TestTransformerTempo::test_audio_type_invalid tests/test_transform.py::TestTransformerTempo::test_factor_invalid tests/test_transform.py::TestTransformerTempo::test_quick_invalid tests/test_transform.py::TestTransformerTreble::test_frequency_invalid tests/test_transform.py::TestTransformerTreble::test_gain_db_invalid tests/test_transform.py::TestTransformerTreble::test_slope_invalid tests/test_transform.py::TestTransformerTremolo::test_depth_invalid tests/test_transform.py::TestTransformerTremolo::test_speed_invalid tests/test_transform.py::TestTransformerTrim::test_invalid_end_time tests/test_transform.py::TestTransformerTrim::test_invalid_start_time tests/test_transform.py::TestTransformerTrim::test_invalid_time_pair tests/test_transform.py::TestTransformerUpsample::test_default tests/test_transform.py::TestTransformerUpsample::test_invalid_factor_decimal tests/test_transform.py::TestTransformerUpsample::test_invalid_factor_neg tests/test_transform.py::TestTransformerUpsample::test_invalid_factor_nonnum tests/test_transform.py::TestTransformerVad::test_invalid_activity_threshold tests/test_transform.py::TestTransformerVad::test_invalid_initial_pad tests/test_transform.py::TestTransformerVad::test_invalid_initial_search_buffer tests/test_transform.py::TestTransformerVad::test_invalid_location tests/test_transform.py::TestTransformerVad::test_invalid_max_gap tests/test_transform.py::TestTransformerVad::test_invalid_min_activity_duration tests/test_transform.py::TestTransformerVad::test_invalid_normalize