Git Product home page Git Product logo

mp3-decoder's People

Contributors

chrisbutcher avatar floriscreyf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mp3-decoder's Issues

unsigned char *get_file(const char *dir)

problem - cannot get length of buffer
you are using std::ifstream, why not use std::vector or std::string?

Also, such a mix is a sign of error-prone code style.
you may easily forget delete[] operator.

Do it modern way!
here is replacement version, 4 lines of code, each does bunch of things
Logic is extremely clear:
1. open file
2. create buffer
3. read file to buffer
4 return it

std::string get_file(const std::string& fileName) {
std::ifstream dataFile(dir, std::ios::in | std::ios::binary | std::ios::ate);
std::string dataBuffer(dataFile.tellg(),0);
dataFile.seekg(0, std::ios::beg).read(&dataBuffer[0], dataBuffer.size());
return std::move( dataBuffer );
}

Can't compile VS2017 Win32 x86/x64

Hi, I commented out stream() definition and use in main.cpp but that was not enough to make it compile.

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2005	"struct <unnamed-type-band_index_table> band_index_table" (?band_index_table@@3U<unnamed-type-band_index_table>@@A) already defined in main.obj	mp3-decoder	Z:\mp3-decoder-master\mp3.obj	1	
Error	LNK2005	"struct <unnamed-type-band_width_table> band_width_table" (?band_width_table@@3U<unnamed-type-band_width_table>@@A) already defined in main.obj	mp3-decoder	Z:\mp3-decoder-master\mp3.obj	1	
Error	LNK2005	"struct <unnamed-type-quad_table_1> quad_table_1" (?quad_table_1@@3U<unnamed-type-quad_table_1>@@A) already defined in main.obj	mp3-decoder	Z:\mp3-decoder-master\mp3.obj	1	
Error	LNK1169	one or more multiply defined symbols found	mp3-decoder	Z:\mp3-decoder-master\Debug\mp3-decoder.exe	1	

I'm not experienced enough to be able to solve this. I'm guessing all these are related:

PS: also id3.cpp was causing failure in line 111 while (!std::regex_match((string){(char)buffer[i]}, re) && i < size) {, which I turned into

	string istep;
	istep = (char)buffer[0];

	while (!std::regex_match(istep, re) && i < size) {
		istep = (char)buffer[i];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.