Coder Social home page Coder Social logo

Comments (14)

ThuCommix avatar ThuCommix commented on July 21, 2024

Also confirmed for 1_1.

from cscore.

filoe avatar filoe commented on July 21, 2024

Did you dispose the WaveWriter?

from cscore.

ThuCommix avatar ThuCommix commented on July 21, 2024

Yes, I'm using it in a using-block. Sorry for late reply.

from cscore.

filoe avatar filoe commented on July 21, 2024

I am going to have a look at it. But you could take a look at the cscore decoder. The cscore decoder should be able to read the datasize.

from cscore.

ThuCommix avatar ThuCommix commented on July 21, 2024

Do you mean the WaveFileReader? If yes it simply ignores the data length.

from cscore.

filoe avatar filoe commented on July 21, 2024

Ok, I am going to debug it today or in the next few days. But by just reading the code, I can't find any mistake in the WaveWriter class. Every Write operation increments the _dataLength correctly. And the Dispose method calls the WriteHeader method which writes down the _dataLength at the correct position.

from cscore.

ThuCommix avatar ThuCommix commented on July 21, 2024

You also writing the header in the ctor https://github.com/filoe/cscore/blob/master/CSCore/Codecs/WAV/WaveWriter.cs#L54

from cscore.

filoe avatar filoe commented on July 21, 2024

Of course, the line you mentioned reserves some space for the header inside of the stream. But the content of the header gets written by the WriteHeader method which gets called in the Dispose method: https://github.com/filoe/cscore/blob/master/CSCore/Codecs/WAV/WaveWriter.cs#L265

from cscore.

ThuCommix avatar ThuCommix commented on July 21, 2024

Yes but line 60 is still not necessary as far as I can see. But thats not the problem just a side note 🍡

from cscore.

filoe avatar filoe commented on July 21, 2024

You're right, line 60 or the loop at line 54 would not be necessary.

from cscore.

ThuCommix avatar ThuCommix commented on July 21, 2024

Also you could seek the stream by 44 bytes so you don't need to write 0 44 times. Don't know if this would bring a bit more performance.

from cscore.

filoe avatar filoe commented on July 21, 2024

You're right again, but I can't reproduce your issue. I am sorry. I've just encoded a wav file:
0

And the cscore also is able to read it correctly:
1

But let me tell you, that your decoder won't work for all wav files. In order to be more flexible what different wav files concerns, you may should implement wave file chunks instead of reading the fmt and data chunk straigt forward.

from cscore.

filoe avatar filoe commented on July 21, 2024

Still waiting on any updates...

from cscore.

filoe avatar filoe commented on July 21, 2024

Since this issue could not be reproduced, and @ThuCommix did not respond for months... I would guess I can close this.

from cscore.

Related Issues (20)

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.