Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
OggSound.h
1/*
2Copyright (C) 2017-2018,2021,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGAMES_OGGSOUND_H
17#define AEONGAMES_OGGSOUND_H
18#include <string>
19#include <vector>
20#include "aeongames/Sound.hpp"
21#include "vorbis/vorbisfile.h"
22
23namespace AeonGames
24{
30 bool DecodeOGG ( Sound& aSound, size_t aBufferSize, const void* aBuffer );
32 class OggSound final : public Sound
33 {
34 public:
37 OggSound ( const std::string & aFileName );
39 ~OggSound() final;
40 private:
43 static size_t Read ( void *ptr, size_t size, size_t nmemb, void *datasource );
44 static int Seek ( void *datasource, ogg_int64_t offset, int whence );
45 static int Close ( void *datasource );
46 static long Tell ( void *datasource );
47 static const ov_callbacks Callbacks;
49 //OggVorbis_File mOggVorbisFile{};
50 std::vector<uint8_t> mData;
51 };
52}
53#endif
OggSound(const std::string &aFileName)
Constructs an OggSound by loading from the specified file.
Definition OggSound.cpp:62
~OggSound() final
Destructor.
Abstract base class representing a decoded sound resource.
Definition Sound.hpp:27
<- This is here just for the literals
Definition AABB.hpp:31
bool DecodeOGG(Sound &aSound, size_t aBufferSize, const void *aBuffer)
Decodes OGG Vorbis audio data from a memory buffer into a Sound.
Definition OggSound.cpp:25
STL namespace.