mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
src/wav.c : For u-law and A-law files, write an 18 byte 'fmt ' chunk.
This commit is contained in:
parent
6b032a1b5f
commit
7cb04151b9
@ -1,3 +1,10 @@
|
||||
2011-03-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* src/wav.c
|
||||
For u-law and A-law files, write an 18 byte 'fmt ' chunk instead of a 16
|
||||
byte one. Win98 accepts files with a 16 but not 18 byte 'fmt' chunk. Later
|
||||
version accept 18 byte but not 16 byte.
|
||||
|
||||
2011-03-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* doc/FAQ.html
|
||||
|
12
src/wav.c
12
src/wav.c
@ -756,27 +756,27 @@ wav_write_fmt_chunk (SF_PRIVATE *psf)
|
||||
break ;
|
||||
|
||||
case SF_FORMAT_ULAW :
|
||||
fmt_size = 2 + 2 + 4 + 4 + 2 + 2 ;
|
||||
fmt_size = 2 + 2 + 4 + 4 + 2 + 2 + 2 ;
|
||||
|
||||
/* fmt : format, channels, samplerate */
|
||||
psf_binheader_writef (psf, "4224", fmt_size, WAVE_FORMAT_MULAW, psf->sf.channels, psf->sf.samplerate) ;
|
||||
/* fmt : bytespersec */
|
||||
psf_binheader_writef (psf, "4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ;
|
||||
/* fmt : blockalign, bitwidth */
|
||||
psf_binheader_writef (psf, "22", psf->bytewidth * psf->sf.channels, 8) ;
|
||||
/* fmt : blockalign, bitwidth, extrabytes */
|
||||
psf_binheader_writef (psf, "222", psf->bytewidth * psf->sf.channels, 8, 0) ;
|
||||
|
||||
add_fact_chunk = SF_TRUE ;
|
||||
break ;
|
||||
|
||||
case SF_FORMAT_ALAW :
|
||||
fmt_size = 2 + 2 + 4 + 4 + 2 + 2 ;
|
||||
fmt_size = 2 + 2 + 4 + 4 + 2 + 2 + 2 ;
|
||||
|
||||
/* fmt : format, channels, samplerate */
|
||||
psf_binheader_writef (psf, "4224", fmt_size, WAVE_FORMAT_ALAW, psf->sf.channels, psf->sf.samplerate) ;
|
||||
/* fmt : bytespersec */
|
||||
psf_binheader_writef (psf, "4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ;
|
||||
/* fmt : blockalign, bitwidth */
|
||||
psf_binheader_writef (psf, "22", psf->bytewidth * psf->sf.channels, 8) ;
|
||||
/* fmt : blockalign, bitwidth, extrabytes */
|
||||
psf_binheader_writef (psf, "222", psf->bytewidth * psf->sf.channels, 8, 0) ;
|
||||
|
||||
add_fact_chunk = SF_TRUE ;
|
||||
break ;
|
||||
|
Loading…
Reference in New Issue
Block a user