scenepic 1.1.0
3D Visualization Made Easy
audio_track.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#ifndef _SCENEPIC_AUDIO_TRACK_H_
5#define _SCENEPIC_AUDIO_TRACK_H_
6
7#include "json_value.h"
8
9#include <cstdint>
10#include <string>
11#include <vector>
12
13namespace scenepic
14{
17 {
18 public:
22 void load(const std::string& path);
23
25 std::string to_string() const;
26
31
33 const std::string& audio_id() const;
34
36 const std::vector<std::uint8_t>& data() const;
37
39 std::vector<std::uint8_t>& data();
40
42 AudioTrack& data(const std::vector<std::uint8_t>& value);
43
45 const std::string& ext() const;
46
48 AudioTrack& ext(const std::string& value);
49
50 private:
51 friend class Scene;
52
56 AudioTrack(const std::string& audio_id);
57
58 std::vector<std::uint8_t> m_data;
59 std::string m_audio_id;
60 std::string m_ext;
61 };
62} // namespace scenepic
63
64#endif
Audio track that can be connected to a canvas.
Definition: audio_track.h:17
const std::string & audio_id() const
A unique identifier for the audio.
AudioTrack & ext(const std::string &value)
The extension of the audio track (e.g.
JsonValue to_json() const
Convert this object into ScenePic json.
AudioTrack & data(const std::vector< std::uint8_t > &value)
The encoded binary audio data.
const std::vector< std::uint8_t > & data() const
The encoded binary audio data.
void load(const std::string &path)
Load an audio file from the disk.
std::string to_string() const
Return a JSON string representing the object.
const std::string & ext() const
The extension of the audio track (e.g.
std::vector< std::uint8_t > & data()
The encoded binary audio data.
Representation of a JSON value according to the specification at https://www.json....
Definition: json_value.h:30
Top level container representing an entire ScenePic.
Definition: scene.h:58
Definition: audio_track.h:14