nomlib
Loading...
Searching...
No Matches
StreamSound.hpp
1#pragma once
2
3#include "nomlib/audio/Sound.hpp"
4#include "nomlib/types.hpp"
5#include "export.hpp"
6
7namespace nom {
8namespace audio {
9
10// OggSound
11class NOM_EXPORT StreamSound: public Sound
12{
13 private:
14 void init(const std::string& filename);
15 void init(nom::int16* samples, nom::uint32 format, int num_channels);
16
17 public:
18 typedef Sound super;
19 virtual ~StreamSound();
20
21 void close();
22
23 // NO-OP init
24 StreamSound();
25 // init(filename);
26 StreamSound(const std::string& filename);
27 // init(samples, fmt, num_channels);
28 StreamSound(nom::int16* samples, nom::uint32 format, int channels);
29
30 // TODO(JEFF): Change return type of bool to void?
31 virtual bool open(const std::string& filename);
32
33 virtual nom::real64 stream(nom::uint32 buffer, nom::real64 pos);
34};
35
36} // namespace audio
37} // namespace nom
int channels() const
Obtain the number of audio channels of this sound instance.
int format() const
Obtain the audio channel format as expressed in AL_FORMAT_XXX.
nom::uint & buffer()
Identifier number for the implementation-defined buffer system.