Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
TensorSpeech
GitHub Repository: TensorSpeech/TensorFlowTTS
Path: blob/master/examples/cpptflite/src/VoxCommon.h
1559 views
1
#pragma once
2
/*
3
VoxCommon.hpp : Defines common data structures and constants to be used with TensorVox
4
*/
5
#include <iostream>
6
#include <vector>
7
#include "AudioFile.h"
8
// #include "ext/CppFlow/include/Tensor.h"
9
// #include <stdexcept>
10
11
#define IF_RETURN(cond,ret) if (cond){return ret;}
12
#define VX_IF_EXCEPT(cond,ex) if (cond){throw std::invalid_argument(ex);}
13
14
15
template<typename T>
16
struct TFTensor {
17
std::vector<T> Data;
18
std::vector<int64_t> Shape;
19
size_t TotalSize;
20
};
21
22
namespace VoxUtil {
23
24
void ExportWAV(const std::string& Filename, const std::vector<float>& Data, unsigned SampleRate);
25
}
26
27