mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-10 12:29:15 +02:00
+ support reading .wav files that have extra data in the end of the 'fmt '
chunk. Added test case, which is a file, generated by the Euphoric emulator. git-svn-id: trunk@47461 -
This commit is contained in:
parent
28bdb364f0
commit
46b35256bd
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -4344,6 +4344,9 @@ packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_32.wav.raw -text
|
||||
packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_8.wav -text svneol=unset#audio/x-wav
|
||||
packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_8.wav.info.txt svneol=native#text/plain
|
||||
packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_8.wav.raw -text svneol=unset#application/octet-stream
|
||||
packages/fcl-sound/tests/data/wav/reader/valid/euphoric_tape.wav -text svneol=unset#audio/x-wav
|
||||
packages/fcl-sound/tests/data/wav/reader/valid/euphoric_tape.wav.info.txt svneol=native#text/plain
|
||||
packages/fcl-sound/tests/data/wav/reader/valid/euphoric_tape.wav.raw -text svneol=unset#application/octet-stream
|
||||
packages/fcl-sound/tests/tcwavreader.pas svneol=native#text/plain
|
||||
packages/fcl-sound/tests/testfclsound.lpi svneol=native#text/plain
|
||||
packages/fcl-sound/tests/testfclsound.lpr svneol=native#text/plain
|
||||
|
@ -94,7 +94,9 @@ begin
|
||||
Result := Result and (riff.ChunkHeader.ID = AUDIO_CHUNK_ID_RIFF) and (riff.Format = AUDIO_CHUNK_ID_WAVE);
|
||||
Result := Result and (fStream.Read(fmt, sizeof(fmt)) = sizeof(fmt));
|
||||
LEtoN(fmt);
|
||||
Result := Result and (fmt.ChunkHeader.ID = AUDIO_CHUNK_ID_fmt);
|
||||
Result := Result and (fmt.ChunkHeader.ID = AUDIO_CHUNK_ID_fmt) and ((fmt.ChunkHeader.Size + 8) >= sizeof(fmt));
|
||||
if Result and ((fmt.ChunkHeader.Size + 8) > sizeof(fmt)) then
|
||||
fStream.Seek((fmt.ChunkHeader.Size + 8) - sizeof(fmt), soCurrent);
|
||||
if Result and (fmt.Format <> 1) then
|
||||
Exit(False);
|
||||
end;
|
||||
|
BIN
packages/fcl-sound/tests/data/wav/reader/valid/euphoric_tape.wav
Normal file
BIN
packages/fcl-sound/tests/data/wav/reader/valid/euphoric_tape.wav
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
||||
4800 1 8
|
File diff suppressed because one or more lines are too long
@ -84,6 +84,7 @@ begin
|
||||
TestValidFile('44k_stereo_24.wav');
|
||||
TestValidFile('44k_stereo_32.wav');
|
||||
TestValidFile('44k_mono_16_tag.wav');
|
||||
TestValidFile('euphoric_tape.wav');
|
||||
end;
|
||||
|
||||
|
||||
|
@ -49,6 +49,7 @@
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="../src"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
|
Loading…
Reference in New Issue
Block a user