Lines Matching refs:sf
1073 memcpy (data, &psf->sf, sizeof (SF_INFO)) ;
1102 { int format = SF_CONTAINER (psf->sf.format) ;
1117 format = SF_CODEC (psf->sf.format) ;
1138 { psf->peak_info = peak_info_calloc (psf->sf.channels) ;
1169 if (data == NULL || datasize != SIGNED_SIZEOF (double) * psf->sf.channels)
1174 if (data == NULL || datasize != SIGNED_SIZEOF (double) * psf->sf.channels)
1186 if (data == NULL || datasize != SIGNED_SIZEOF (double) * psf->sf.channels)
1244 psf->sf.frames = position ;
1256 if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_RAW)
1274 if ((SF_CODEC (psf->sf.format)) == SF_FORMAT_FLOAT)
1276 else if ((SF_CODEC (psf->sf.format)) == SF_FORMAT_DOUBLE)
1301 { int format = SF_CONTAINER (psf->sf.format) ;
1332 { int format = SF_CONTAINER (psf->sf.format) ;
1430 if (data == NULL || datasize != SIGNED_SIZEOF (psf->channel_map [0]) * psf->sf.channels)
1443 if (data == NULL || datasize != SIGNED_SIZEOF (psf->channel_map [0]) * psf->sf.channels)
1450 for (iptr = data ; iptr < (int*) data + psf->sf.channels ; iptr++)
1511 if (! psf->sf.seekable)
1569 seek_from_start = psf->sf.frames + offset ;
1586 else if (seek_from_start < 0 || seek_from_start > psf->sf.frames)
1657 return psf->sf.samplerate * psf->sf.channels * psf->bytewidth ;
1662 switch (SF_CODEC (psf->sf.format))
1666 return (psf->sf.samplerate * psf->sf.channels) / 2 ;
1669 return (psf->sf.samplerate * psf->sf.channels * 13000) / 8000 ;
1672 return psf->sf.samplerate / 4 + 10 ;
1675 return psf->sf.samplerate * 3 / 8 + 10 ;
1678 return psf->sf.samplerate / 2 + 10 ;
1681 return (psf->sf.samplerate * psf->sf.channels) / 2 ;
1684 return (psf->sf.samplerate * psf->sf.channels * 3) / 8 ;
1687 return (psf->sf.samplerate * psf->sf.channels * 5) / 8 ;
1718 if (bytes < 0 || psf->read_current >= psf->sf.frames)
1723 if (bytes % (psf->sf.channels * bytewidth))
1734 if (psf->read_current + count / blockwidth <= psf->sf.frames)
1737 { count = (psf->sf.frames - psf->read_current) * blockwidth ;
1740 psf->read_current = psf->sf.frames ;
1771 if (len % psf->sf.channels)
1776 if (psf->read_current >= psf->sf.frames)
1792 if (psf->read_current + count / psf->sf.channels <= psf->sf.frames)
1793 psf->read_current += count / psf->sf.channels ;
1795 { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ;
1798 psf->read_current = psf->sf.frames ;
1826 if (psf->read_current >= psf->sf.frames)
1827 { psf_memset (ptr, 0, frames * psf->sf.channels * sizeof (short)) ;
1840 count = psf->read_short (psf, ptr, frames * psf->sf.channels) ;
1842 if (psf->read_current + count / psf->sf.channels <= psf->sf.frames)
1843 psf->read_current += count / psf->sf.channels ;
1845 { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ;
1846 extra = frames * psf->sf.channels - count ;
1848 psf->read_current = psf->sf.frames ;
1853 return count / psf->sf.channels ;
1879 if (len % psf->sf.channels)
1884 if (psf->read_current >= psf->sf.frames)
1900 if (psf->read_current + count / psf->sf.channels <= psf->sf.frames)
1901 psf->read_current += count / psf->sf.channels ;
1903 { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ;
1906 psf->read_current = psf->sf.frames ;
1934 if (psf->read_current >= psf->sf.frames)
1935 { psf_memset (ptr, 0, frames * psf->sf.channels * sizeof (int)) ;
1948 count = psf->read_int (psf, ptr, frames * psf->sf.channels) ;
1950 if (psf->read_current + count / psf->sf.channels <= psf->sf.frames)
1951 psf->read_current += count / psf->sf.channels ;
1953 { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ;
1954 extra = frames * psf->sf.channels - count ;
1956 psf->read_current = psf->sf.frames ;
1961 return count / psf->sf.channels ;
1987 if (len % psf->sf.channels)
1992 if (psf->read_current >= psf->sf.frames)
2008 if (psf->read_current + count / psf->sf.channels <= psf->sf.frames)
2009 psf->read_current += count / psf->sf.channels ;
2011 { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ;
2014 psf->read_current = psf->sf.frames ;
2042 if (psf->read_current >= psf->sf.frames)
2043 { psf_memset (ptr, 0, frames * psf->sf.channels * sizeof (float)) ;
2056 count = psf->read_float (psf, ptr, frames * psf->sf.channels) ;
2058 if (psf->read_current + count / psf->sf.channels <= psf->sf.frames)
2059 psf->read_current += count / psf->sf.channels ;
2061 { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ;
2062 extra = frames * psf->sf.channels - count ;
2064 psf->read_current = psf->sf.frames ;
2069 return count / psf->sf.channels ;
2095 if (len % psf->sf.channels)
2100 if (psf->read_current >= psf->sf.frames)
2116 if (psf->read_current + count / psf->sf.channels <= psf->sf.frames)
2117 psf->read_current += count / psf->sf.channels ;
2119 { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ;
2122 psf->read_current = psf->sf.frames ;
2150 if (psf->read_current >= psf->sf.frames)
2151 { psf_memset (ptr, 0, frames * psf->sf.channels * sizeof (double)) ;
2164 count = psf->read_double (psf, ptr, frames * psf->sf.channels) ;
2166 if (psf->read_current + count / psf->sf.channels <= psf->sf.frames)
2167 psf->read_current += count / psf->sf.channels ;
2169 { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ;
2170 extra = frames * psf->sf.channels - count ;
2172 psf->read_current = psf->sf.frames ;
2177 return count / psf->sf.channels ;
2207 if (len % (psf->sf.channels * bytewidth))
2228 if (psf->write_current > psf->sf.frames)
2229 { psf->sf.frames = psf->write_current ;
2262 if (len % psf->sf.channels)
2284 psf->write_current += count / psf->sf.channels ;
2288 if (psf->write_current > psf->sf.frames)
2289 { psf->sf.frames = psf->write_current ;
2334 count = psf->write_short (psf, ptr, frames * psf->sf.channels) ;
2336 psf->write_current += count / psf->sf.channels ;
2340 if (psf->write_current > psf->sf.frames)
2341 { psf->sf.frames = psf->write_current ;
2348 return count / psf->sf.channels ;
2374 if (len % psf->sf.channels)
2396 psf->write_current += count / psf->sf.channels ;
2400 if (psf->write_current > psf->sf.frames)
2401 { psf->sf.frames = psf->write_current ;
2446 count = psf->write_int (psf, ptr, frames * psf->sf.channels) ;
2448 psf->write_current += count / psf->sf.channels ;
2452 if (psf->write_current > psf->sf.frames)
2453 { psf->sf.frames = psf->write_current ;
2460 return count / psf->sf.channels ;
2486 if (len % psf->sf.channels)
2508 psf->write_current += count / psf->sf.channels ;
2512 if (psf->write_current > psf->sf.frames)
2513 { psf->sf.frames = psf->write_current ;
2558 count = psf->write_float (psf, ptr, frames * psf->sf.channels) ;
2560 psf->write_current += count / psf->sf.channels ;
2564 if (psf->write_current > psf->sf.frames)
2565 { psf->sf.frames = psf->write_current ;
2572 return count / psf->sf.channels ;
2598 if (len % psf->sf.channels)
2620 psf->write_current += count / psf->sf.channels ;
2624 if (psf->write_current > psf->sf.frames)
2625 { psf->sf.frames = psf->write_current ;
2670 count = psf->write_double (psf, ptr, frames * psf->sf.channels) ;
2672 psf->write_current += count / psf->sf.channels ;
2676 if (psf->write_current > psf->sf.frames)
2677 { psf->sf.frames = psf->write_current ;
2684 return count / psf->sf.channels ;
2734 { psf->sf.channels = 1 ;
2735 psf->sf.samplerate = 8000 ;
2739 { psf->sf.channels = 1 ;
2740 psf->sf.samplerate = 8000 ;
2745 { psf->sf.channels = 1 ;
2746 psf->sf.samplerate = 8000 ;
2750 { psf->sf.channels = 1 ;
2751 psf->sf.samplerate = 6000 ;
2755 { psf->sf.channels = 1 ;
2756 psf->sf.samplerate = 8000 ;
2951 if (psf->blockwidth && psf->blockwidth != psf->sf.channels * psf->bytewidth)
2953 psf->sf.channels * psf->bytewidth) ;
3045 memcpy (&psf->sf, sfinfo, sizeof (SF_INFO)) ;
3063 psf->sf.sections = 1 ;
3068 { psf->sf.seekable = SF_FALSE ;
3072 { psf->sf.seekable = SF_TRUE ;
3111 if ((SF_CONTAINER (psf->sf.format)) == 0)
3115 if ((SF_CODEC (psf->sf.format)) == 0)
3120 if (sf_format_check (&psf->sf) == 0)
3125 else if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_RAW)
3127 psf->sf.format = guess_file_type (psf) ;
3129 if (psf->sf.format == 0)
3130 psf->sf.format = format_from_extension (psf) ;
3137 switch (SF_CODEC (psf->sf.format))
3166 switch (SF_CONTAINER (psf->sf.format))
3291 format = SF_CONTAINER (psf->sf.format) ;
3315 if (psf->file.mode == SFM_RDWR && sf_format_check (&psf->sf) == 0)
3320 if (validate_sfinfo (&psf->sf) == 0)
3336 { psf->write_current = psf->sf.frames ;
3337 psf->have_written = psf->sf.frames > 0 ? SF_TRUE : SF_FALSE ;
3340 memcpy (sfinfo, &psf->sf, sizeof (SF_INFO)) ;