Lines Matching refs:file
53 SNDFILE * file ;
69 /* Set up output file type. */
74 /* Write the output file. */
75 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ;
76 test_write_short_or_die (file, 0, data_out.s, ARRAY_LEN (data_out.s), __LINE__) ;
77 sf_close (file) ;
79 /* Read the file in again. */
82 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
83 test_read_short_or_die (file, 0, data_in.s, ARRAY_LEN (data_in.s), __LINE__) ;
84 sf_close (file) ;
91 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
93 test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ;
94 test_read_short_or_die (file, 0, seek_data, ARRAY_LEN (seek_data), __LINE__) ;
97 /* Test seek to end of file. */
98 test_seek_or_die (file, 0, SEEK_END, sfinfo.frames, sfinfo.channels, __LINE__) ;
100 sf_close (file) ;
111 SNDFILE * file ;
127 /* Set up output file type. */
132 /* Write the output file. */
133 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ;
134 test_write_int_or_die (file, 0, data_out.i, ARRAY_LEN (data_out.i), __LINE__) ;
135 sf_close (file) ;
137 /* Read the file in again. */
140 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
141 test_read_int_or_die (file, 0, data_in.i, ARRAY_LEN (data_in.i), __LINE__) ;
142 sf_close (file) ;
149 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
151 test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ;
152 test_read_int_or_die (file, 0, seek_data, ARRAY_LEN (seek_data), __LINE__) ;
155 sf_close (file) ;
166 SNDFILE * file ;
176 /* Set up output file type. */
181 /* Write the output file. */
182 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ;
183 test_write_float_or_die (file, 0, data_out.f, ARRAY_LEN (data_out.f), __LINE__) ;
184 sf_close (file) ;
186 /* Read the file in again. */
189 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
190 test_read_float_or_die (file, 0, data_in.f, ARRAY_LEN (data_in.f), __LINE__) ;
191 sf_close (file) ;
198 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
200 test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ;
201 test_read_float_or_die (file, 0, seek_data, ARRAY_LEN (seek_data), __LINE__) ;
204 sf_close (file) ;
215 SNDFILE * file ;
225 /* Set up output file type. */
230 /* Write the output file. */
231 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ;
232 test_write_double_or_die (file, 0, data_out.d, ARRAY_LEN (data_out.d), __LINE__) ;
233 sf_close (file) ;
235 /* Read the file in again. */
238 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
239 test_read_double_or_die (file, 0, data_in.d, ARRAY_LEN (data_in.d), __LINE__) ;
240 sf_close (file) ;
247 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
249 test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ;
250 test_read_double_or_die (file, 0, seek_data, ARRAY_LEN (seek_data), __LINE__) ;
253 sf_close (file) ;
266 SNDFILE * file ;
281 /* Set up output file type. */
286 /* Write the output file. */
287 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ;
288 test_write_float_or_die (file, 0, stereo_out, ARRAY_LEN (stereo_out), __LINE__) ;
289 sf_close (file) ;
291 /* Open file in again for reading. */
293 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
295 /* Read in the whole file. */
296 test_read_float_or_die (file, 0, stereo_out, ARRAY_LEN (stereo_out), __LINE__) ;
299 test_seek_or_die (file, 234, SEEK_SET, 234, sfinfo.channels, __LINE__) ;
300 test_readf_float_or_die (file, 0, data, 10, __LINE__) ;
303 test_seek_or_die (file, 442, SEEK_SET, 442, sfinfo.channels, __LINE__) ;
304 test_readf_float_or_die (file, 0, data, 10, __LINE__) ;
307 test_seek_or_die (file, 12, SEEK_CUR, 442 + 10 + 12, sfinfo.channels, __LINE__) ;
308 test_readf_float_or_die (file, 0, data, 10, __LINE__) ;
311 test_seek_or_die (file, 12, SEEK_CUR, 442 + 20 + 24, sfinfo.channels, __LINE__) ;
312 test_readf_float_or_die (file, 0, data, 10, __LINE__) ;
316 test_seek_or_die (file, pos, SEEK_END, 500, sfinfo.channels, __LINE__) ;
317 test_readf_float_or_die (file, 0, data, 10, __LINE__) ;
321 test_seek_or_die (file, pos, SEEK_END, 10, sfinfo.channels, __LINE__) ;
322 test_readf_float_or_die (file, 0, data, 10, __LINE__) ;
325 sf_close (file) ;
336 SNDFILE * file ;
347 /* Set up output file type. */
352 /* Write the output file. */
353 file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ;
354 if (sf_command (file, SFC_SET_ORIGINAL_SAMPLERATE, &original_samplerate, sizeof (original_samplerate)) != SF_TRUE)
358 test_write_double_or_die (file, 0, data_out.d, ARRAY_LEN (data_out.d), __LINE__) ;
359 if (sf_command (file, SFC_SET_ORIGINAL_SAMPLERATE, &original_samplerate, sizeof (original_samplerate)) != SF_FALSE)
363 sf_close (file) ;
365 /* Read the file in again. */
369 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
370 if (sf_command (file, SFC_GET_ORIGINAL_SAMPLERATE, &original_samplerate, sizeof (original_samplerate)) != SF_TRUE
375 test_read_double_or_die (file, 0, data_in.d, 8, __LINE__) ;
376 if (sf_command (file, SFC_SET_ORIGINAL_SAMPLERATE, &original_samplerate, sizeof (original_samplerate)) == SF_TRUE)
380 sf_close (file) ;
383 file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ;
386 if (sf_command (file, SFC_SET_ORIGINAL_SAMPLERATE, &original_samplerate, sizeof (original_samplerate)) != SF_TRUE)
390 if (sf_command (file, SFC_GET_CURRENT_SF_INFO, &sfinfo, sizeof (sfinfo)))
398 test_read_double_or_die (file, 0, data_out.d, sfinfo.frames, __LINE__) ;
400 sf_close (file) ;