Commit 5bb671ad authored by Stéphane NGNEPIEPAYE WEMBE's avatar Stéphane NGNEPIEPAYE WEMBE
Browse files

Trying reading au

parent 9bbe7103
......@@ -33,9 +33,31 @@
//4 sample rate the number of samples/second, e.g., 8000
//5 channels the number of interleaved channels, e.g., 1 for mono, 2 for stereo; more channels possible, but may not be supported by all readers.
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <string>
#include <filesystem>
#include <vector>
#include "etypes.h"
DataVector readAuFile(std::filesystem::path &file_path) {
namespace fs = std::filesystem;
uint32_t read_word(std::ifstream &myFile) {
uint32_t word;
myFile.read(reinterpret_cast<char *>(&word), sizeof(uint32_t));
return word;
}
DataVector readAuFile(const std::string file_path){//(std::filesystem::path &file_path) {
DataVector dataVector;
FILE *fin = fopen(file_path.c_str(), "rb");
std::ifstream myFile(file_path);
uint32_t word = read_word(myFile);
std::cout << "first word" << std::hex << word << std::endl;
return dataVector;
};
......
#include "au_reading.h"
int main(int argc, char const *argv[])
{
std::string fileName = "../DATASETS/genres/blues/blues.00001.au";
DataVector dataVector ;
dataVector = readAuFile(fileName);
return 0;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment