Giter Site home page Giter Site logo

Replaying audio about timbre.js HOT 7 CLOSED

scottgarner avatar scottgarner commented on July 18, 2024
Replaying audio

from timbre.js.

Comments (7)

mohayonao avatar mohayonao commented on July 18, 2024

Sorry, I am no longer using timbre.js.
If my memory is correct, the below code maybe replay repeatedly.

var T = require("timbre");
var audio_src = T("audio", {}).loadthis("cicada_2.wav");
setInterval(function(){
    console.log("trigger");
    audio_src.clone().play().on("ended", function() {
      this.pause();
    });
}, 2000);

from timbre.js.

scottgarner avatar scottgarner commented on July 18, 2024

Thank you for the quick response!

So timbre isn't really supported anymore? I wonder if you have any other suggestions for node.js audio modules that can easily trigger samples.

from timbre.js.

jbielick avatar jbielick commented on July 18, 2024

The WebAudio API has most of the convenience and features you're probably looking for.
There's a number of great tutorials.

I wrote a very simple wrapper on top of the audio api in order to do what you're talking about. It's called groove.js. It's not as fleshed-out as you'll probably want it to be, but it got me started on building this project.

Here's the the code might look like using coffeescript, promises and angular.js: https://github.com/jbielick/beetmachine/blob/master/app/scripts/services/sample.coffee

from timbre.js.

scottgarner avatar scottgarner commented on July 18, 2024

Thank you for the suggestion, @jbielick.

I'm working in node.js and was drawn to timbre.js because it works with the speaker module. I do see that there is a web audio module for node, though, so maybe that's the better direction.

from timbre.js.

jbielick avatar jbielick commented on July 18, 2024

ah, interesting. I hadn't gotten to that point yet, but I'm also interested in building / sequencing the patterns built in the browser on the server side so they can be written to file (wav). Let me know what you find if don't mind!

from timbre.js.

scottgarner avatar scottgarner commented on July 18, 2024

I think I'm going to stick with timbre for my current prototype now that I have sounds triggering. I'll keep an eye out for other options.

from timbre.js.

takosuke avatar takosuke commented on July 18, 2024

So has timbre become redundant because of the web audio api?That's a pity, I really liked this project. Keep up the good work!

from timbre.js.

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.