ArchiveAudio.h
Go to the documentation of this file.
1 // Copyright (c) 2016 Digital Barriers
4 
19 #pragma once
20 
21 #include "EdgeVisSDK.h"
22 #include "Pimpl.h"
23 
24 namespace EdgeVisEncoderSDK
25 {
26  class ArchiveAudioImpl;
27  class ArchiveAudio : public EdgeVisSDKPimpl<ArchiveAudioImpl>
28  {
29  public:
30 
31 
53  DB_EDGEVIS_SDK ArchiveAudio(int16_t format, byte_array data, int8_t bits_per_sample, int32_t sample_rate, int64_t timestamp, int8_t channels, int8_t input);
54 
55  DB_EDGEVIS_SDK ArchiveAudio(int16_t format, byte_array data, std::wstring sdpConfig, int64_t timestamp, int64_t duration);
56 
57  EdgeVisSDKPimplWeakConstructor(ArchiveAudio);
58 
59  public:
60 
64  DB_EDGEVIS_SDK void Assign(int16_t format, byte_array data, int8_t bits_per_sample, int32_t sample_rate, int64_t timestamp, int8_t channels, int8_t input);
65 
66 
73  DB_EDGEVIS_SDK int16_t GetFormat() const;
74 
80  DB_EDGEVIS_SDK int8_t GetBitsPerSample() const;
81 
87  DB_EDGEVIS_SDK int32_t GetSampleRate() const;
88 
95  DB_EDGEVIS_SDK int64_t GetTimestamp() const;
96 
103  DB_EDGEVIS_SDK int8_t GetChannels() const;
104 
110  DB_EDGEVIS_SDK int8_t GetInput() const;
111 
117  DB_EDGEVIS_SDK byte_array GetData() const;
118 
124  DB_EDGEVIS_SDK std::wstring GetSDP() const;
125 
126  //num_samples = (data_len/(bits_per_sample*num_channels))
127  //duration = (num_samples / sample_rate)
128 
134  DB_EDGEVIS_SDK int64_t GetDuration() const;
135  };
136 }
DB_EDGEVIS_SDK int64_t GetTimestamp() const
Returns the timestamp of the audio data The timestamp in in milliseconds since 1970 (Unix time) ...
DB_EDGEVIS_SDK int8_t GetInput() const
Returns the video input index this audio is associated with.
DB_EDGEVIS_SDK int32_t GetSampleRate() const
Returns the bits sample rate of the audio data in Hz.
DB_EDGEVIS_SDK void Assign(int16_t format, byte_array data, int8_t bits_per_sample, int32_t sample_rate, int64_t timestamp, int8_t channels, int8_t input)
Assign new audio data to this ArchiveAudio object.
The EdgeVis Encoder SDK namespace.
DB_EDGEVIS_SDK std::wstring GetSDP() const
Returns the audio sdp packet.
A class containing archive audio data.
Definition: ArchiveAudio.h:27
DB_EDGEVIS_SDK ArchiveAudio(int16_t format, byte_array data, int8_t bits_per_sample, int32_t sample_rate, int64_t timestamp, int8_t channels, int8_t input)
Creates an ArchiveAudio object.
DB_EDGEVIS_SDK int8_t GetBitsPerSample() const
Returns the bits per sample.
DB_EDGEVIS_SDK int8_t GetChannels() const
Returns the number of audio channels within the audio data Either 1 or 2 channels.
DB_EDGEVIS_SDK int16_t GetFormat() const
Returns the audio data format.
DB_EDGEVIS_SDK byte_array GetData() const
Returns the audio data.
DB_EDGEVIS_SDK int64_t GetDuration() const
Retrieve the duration of this frame.