Giter Site home page Giter Site logo

blahdio's People

Contributors

colugomusic avatar mazbox avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

mazbox

blahdio's Issues

overflow when using bit_depth==32 in wavpack writing

Using the following code, I get an overflow (e.g. sample value wrapping around from +1 to -1 at the peak of the sine wave) - only at 32 bit:
`
blahdio::AudioDataFormat write_format;

uint32_t num_frames = 44100 * 10;
write_format.bit_depth = 32;
write_format.num_channels = 2;
write_format.num_frames = num_frames;
write_format.sample_rate = 44100;


blahdio::AudioWriter writer("/Users/marek/Desktop/file.wv", blahdio::AudioType::WavPack, write_format);

blahdio::AudioWriter::Callbacks writer_callbacks;

writer_callbacks.should_abort = []() { return false; };

double phase = 0.0;
writer_callbacks.get_next_chunk = [&](float* buffer, std::uint64_t frame, std::uint32_t num_frames) {
	for(int i = 0; i < num_frames; i++) {
		float o = sin(phase);
		phase += 3.14159*2 * 256 / 44100.0;
		buffer[i*2] = o;
		buffer[i*2+1] = o;
	}
};

writer.write_frames(writer_callbacks, 512); // Will throw an exception if an error

`

screenshot:
Screenshot 2021-05-17 at 16 14 07
Not important to me, as 32 bit audio files are overkill in my case, but I'm guessing it's a float math rounding problem maybe in wavpack_writer.cpp

undefined AudioReader(AudioReader::Stream&, AudioType)

when using AudioReader with a Stream

added this to audio_reader.cpp to fix it.

AudioReader::AudioReader(const blahdio::AudioReader::Stream& stream, AudioType type_hint) : impl_(std::make_shared<impl::AudioReader>(stream, type_hint)) { }

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.