tests/ : Fix tests for SF_FORMAT_GSM610.

Commit a0be1713 only allows SF_FORMAT_GSM610 to be used with a sample
rate of 8Khz. Adjust tests to use sample rate of 8000 whenever the
sub-format isf GSM610.
This commit is contained in:
Erik de Castro Lopo 2014-07-02 19:43:25 +10:00
parent a0be1713b5
commit e4253e1609
2 changed files with 7 additions and 7 deletions

View File

@ -204,7 +204,7 @@ float_scaled_test (const char *filename, int allow_exit, int replace_float, int
gen_windowed_sine_float (float_data, DFT_DATA_LENGTH, 1.0) ;
sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
sfinfo.frames = DFT_DATA_LENGTH ;
sfinfo.channels = 1 ;
sfinfo.format = filetype ;
@ -256,7 +256,7 @@ double_scaled_test (const char *filename, int allow_exit, int replace_float, int
gen_windowed_sine_double (double_data, DFT_DATA_LENGTH, 0.95) ;
sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
sfinfo.frames = DFT_DATA_LENGTH ;
sfinfo.channels = 1 ;
sfinfo.format = filetype ;

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 1999-2012 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 1999-2014 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@ -1346,7 +1346,7 @@ channels = 1 ;
for (k = 0 ; k < datalen ; k++)
orig [k] = lrint (orig_buffer.d [k]) ;
sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
sfinfo.frames = 123456789 ; /* Ridiculous value. */
sfinfo.channels = channels ;
sfinfo.format = filetype ;
@ -1554,7 +1554,7 @@ channels = 1 ;
for (k = 0 ; k < datalen ; k++)
orig [k] = lrint (orig_buffer.d [k]) ;
sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
sfinfo.frames = 123456789 ; /* Ridiculous value. */
sfinfo.channels = channels ;
sfinfo.format = filetype ;
@ -1767,7 +1767,7 @@ printf ("** fix this ** ") ;
for (k = 0 ; k < datalen ; k++)
orig [k] = lrint (orig_buffer.d [k]) ;
sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
sfinfo.frames = 123456789 ; /* Ridiculous value. */
sfinfo.channels = channels ;
sfinfo.format = filetype ;
@ -1958,7 +1958,7 @@ channels = 1 ;
gen_signal_double (orig_buffer.d, 32000.0, channels, datalen) ;
sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
sfinfo.frames = 123456789 ; /* Ridiculous value. */
sfinfo.channels = channels ;
sfinfo.format = filetype ;