Code Monkey home page Code Monkey logo

Comments (7)

Dmunch04 avatar Dmunch04 commented on June 24, 2024

It seems like the GenericSound.stream function should do that? Altough it never assigns the data?

from dlib.

Dmunch04 avatar Dmunch04 commented on June 24, 2024

It seems like in order to write the data in the stream function, this should be reversed;

buffer[i] = _data[i];

I might be wrong

from dlib.

Dmunch04 avatar Dmunch04 commented on June 24, 2024

Nevermind that actually won't fix it

from dlib.

gecko0307 avatar gecko0307 commented on June 24, 2024

GenericSound.dup() does exactly that.
Or use copy constructor new GenericSound(snd);, which is the same.

What stream does is filling the fixed-size buffer with a portion of raw sound data, which is useful to send it to audio playback API.

from dlib.

Dmunch04 avatar Dmunch04 commented on June 24, 2024

That wasn't what I was trying to do. Altough I got this to work for me:

foreach (i; 0 .. originalSound.size)
{
     newSound[0, i] = originalSound[1, i];
}

The snippet is from https://github.com/AODQ/aoynthesizer/blob/master/source/app.d

from dlib.

gecko0307 avatar gecko0307 commented on June 24, 2024

Oh I see. If you want to copy data to another channel, or to another sample format, then yes, that is the only way to do it.

from dlib.

Dmunch04 avatar Dmunch04 commented on June 24, 2024

Alright. Thanks. I thought stream was the function to do so, altough I was mistaken. The wiki for the audio module could probably use an example or 2.

Anyway thanks for your help! I'll close the issue as it's been resolved

from dlib.

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.