this repo has no description
1/*
2This file is part of Darling.
3
4Copyright (C) 2020 Lubos Dolezel
5
6Darling is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11Darling is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with Darling. If not, see <http://www.gnu.org/licenses/>.
18*/
19#include "AudioFileWAV.h"
20#include "AVFormatFileObject.h"
21#include "AudioFileFormatGeneric.h"
22
23class AudioFileFormatWAV : public AudioFileFormatGeneric
24{
25public:
26 AudioFileFormatWAV() : AudioFileFormatGeneric('.mp3', "wav") {}
27protected:
28 const Description& description() const override
29 {
30 static const Description d = {
31 .name = "WAVE",
32 .extensions = { "wav" },
33 .utis = { "com.microsoft.waveform-audio", "public.audio", "public.data" },
34 .mimeTypes = { "audio/wav" },
35 .formats = {
36 Format(kAudioFormatLinearPCM, 0, 8),
37 Format(kAudioFormatLinearPCM, kAudioFormatFlagIsSignedInteger, 16),
38 Format(kAudioFormatLinearPCM, kAudioFormatFlagIsSignedInteger, 24),
39 Format(kAudioFormatLinearPCM, kAudioFormatFlagIsSignedInteger, 32),
40 Format(kAudioFormatLinearPCM, kAudioFormatFlagIsFloat, 32),
41 Format(kAudioFormatLinearPCM, kAudioFormatFlagIsFloat, 64),
42 'ulaw', 'alaw'
43 },
44 };
45 return d;
46 }
47};
48
49class WAVComponent : public AVFormatFileObject<AudioFileFormatWAV, AudioFileWAV, '.wav'>
50{
51public:
52 WAVComponent(AudioComponentInstance inInstance) : AVFormatFileObject(inInstance) {}
53};
54
55#pragma GCC visibility push(default)
56AUDIOCOMPONENT_ENTRY(AudioFileComponentFactory, WAVComponent);
57#pragma GCC visibility pop
58
59AudioFileWAV::AudioFileWAV()
60: AudioFileObject('.wav')
61{
62
63}
64
65Boolean AudioFileWAV::IsDataFormatSupported(const AudioStreamBasicDescription *inFormat)
66{
67 return true;
68}