1 /*
2  * Copyright 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #include "WavRIFFChunkHeader.h"
17 #include "stream/InputStream.h"
18 
19 namespace parselib {
20 
21 const RiffID WavRIFFChunkHeader::RIFFID_RIFF = makeRiffID('R', 'I', 'F', 'F');
22 const RiffID WavRIFFChunkHeader::RIFFID_WAVE = makeRiffID('W', 'A', 'V', 'E');
23 
WavRIFFChunkHeader()24 WavRIFFChunkHeader::WavRIFFChunkHeader() : WavChunkHeader(RIFFID_RIFF) {
25     mFormatId = RIFFID_WAVE;
26 }
27 
WavRIFFChunkHeader(RiffID tag)28 WavRIFFChunkHeader::WavRIFFChunkHeader(RiffID tag) : WavChunkHeader(tag) {
29     mFormatId = RIFFID_WAVE;
30 }
31 
read(InputStream * stream)32 void WavRIFFChunkHeader::read(InputStream *stream) {
33     WavChunkHeader::read(stream);
34     stream->read(&mFormatId, sizeof(mFormatId));
35 }
36 
37 } // namespace parselib
38