Hi, again
Thank you for explaining the "endiand" for me. I quickly made the following program to read a WAV file as a test. The compiler that I use interprets the "endians" correctly. At least the output seems to be correct, The text printed out (by ChunkID and Format) is "RIFF" and "WAVE", but not "FIRR" and "EVAW" and the numbers read are also correct.
If you cannot use "form=bibary", you must solve this by using "access=direct", "recl=4" and read 4 bytes each time, but only the header. Note that the "data size is not necessarily a multiple of 4, so you must open the file again with "recl=1" and read again one byte at a time (the data size of the file that I tested was for instance 705 chatacters).
program WAVread
character*4 ChunkID
integer*4 ChunkSize
character*4 Format
character*4 Subchunk1ID
integer*4 Subchunk1Size
integer*2 AudioFormat
integer*2 NumChannels
integer*4 SampleSize
integer*4 ByteRate
integer*2 BlockAlign
integer*2 BitsPerSample
character*4 Subchunk2ID
integer*4 Subchunk2Size
byte data(10000)
open(unit=1, file='sound111.wav',form='binary')
open(unit=2, file='Output.txt',status='unknown')
read(1) ChunkID
read(1) ChunkSize
read(1) Format
read(1) Subchunk1ID
read(1) Subchunk1Size
read(1) AudioFormat
read(1) NumChannels
read(1) SampleSize
read(1) ByteRate
read(1) BlockAlign
read(1) BitsPerSample
read(1) Subchunk2ID
read(1) Subchunk2Size
do i=1,Subchunk2Size
read(1) data(i)
enddo
write(2,*) ChunkID
write(2,*) ChunkSize
write(2,*) Format
write(2,*) Subchunk1ID
write(2,*) Subchunk1Size
write(2,*) AudioFormat
write(2,*) NumChannels
write(2,*) SampleSize
write(2,*) ByteRate
write(2,*) BlockAlign
write(2,*) BitsPerSample
write(2,*) Subchunk2ID
write(2,*) Subchunk2Size
do i=1,Subchunk2Size
write(2,*) data(i)
enddo
end