Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
AudioFile.h
1 #pragma once
2 #include <string>
3 #include <vector>
4 
11 namespace AudioFileUtilities {
22  int getSamples(const std::string& file, float *buf, unsigned int channel, unsigned int startFrame, unsigned int endFrame);
29  int getNumChannels(const std::string& file);
36  int getNumFrames(const std::string& file);
46  int write(const std::string& filename, float *buf, unsigned int channels, unsigned int frames, unsigned int samplerate);
55  int write(const std::string& filename, const std::vector<std::vector<float> >& dataIn, unsigned int sampleRate);
69  std::vector<std::vector<float> > load(const std::string& filename, int maxCount = -1, unsigned int start = 0);
76  std::vector<float> loadMono(const std::string& file);
77 };
int getNumFrames(const std::string &file)
Definition: AudioFileUtilities.cpp:66
std::vector< std::vector< float > > load(const std::string &filename, int maxCount=-1, unsigned int start=0)
Definition: AudioFileUtilities.cpp:135
int getSamples(const std::string &file, float *buf, unsigned int channel, unsigned int startFrame, unsigned int endFrame)
Definition: AudioFileUtilities.cpp:9
int getNumChannels(const std::string &file)
Definition: AudioFileUtilities.cpp:53
int write(const std::string &filename, float *buf, unsigned int channels, unsigned int frames, unsigned int samplerate)
Definition: AudioFileUtilities.cpp:79
std::vector< float > loadMono(const std::string &file)
Definition: AudioFileUtilities.cpp:157