Giter Site home page Giter Site logo

musquito's Introduction

வணக்கம்

என் பெயர் விஜய ஆனந்த். நான் மாமேதைகள் தொல்காப்பியர் திருவள்ளுவர் அதனக்கோடு ஆசான் பிறந்த குமரி மண்ணை சார்ந்தவன்.

musquito's People

Contributors

dependabot[bot] avatar vanand-conga avatar vjai 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

Watchers

 avatar  avatar  avatar  avatar

musquito's Issues

Not working in Vue Project

For some reason when in include musquito like this in my VueJS project it doesn't work it comes with the following error.

This dependency was not found:

* musquito in ./src/main.js, ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&

To install it, you can run: npm install --save musquito

import _ from 'lodash';
import $buzz from 'musquito';
import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

new Vue({
render: h => h(App),
}).$mount('#app')


Here is a link to the repo. 

https://github.com/kyoukhana/audiotest

Has issues streaming, but not preloading

When I try to do:

const buzz = $buzz({
  src: 'https://myurl.com/my-song.mp3',
  stream: true,
  format: 'mp3',
});

buzz.play();

I'll get the following message in the console:

MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://myurl.com/my-song.mp3

But when I set stream to false it loads fine.

I'm trying to replace Howler, and streaming works from it with the same URL, so I'm not sure what the issue is.

How to amplify a low volume sound?

Hi there! I have a rather simplistic case where I need to amplify the audio beyond of what volume property provides. I was wondering if there is a way to do that.

My case goes like this:

const sound = buzz({
       src: props.src,
       loop: true
})

If URL doesn't have .mp3 console will throw error

Lets say your loading tracks that require AUTH like this

/api/user/track/audio/9?token=eyJ0eXAiOi

The api returns the mp3 file

Here is the error I get in the console

All audio resources are loaded 19.app.js:1:1825
Object { url: "http://localhost:8080/api/user/track/audio/9?token=eyJ0eXAiO…YzI2MzkwNTg3NCJ9.FR0Ofig8p2JdHd0ukb_1gyyaS2gNdDTqGSgM1WhbyWg", value: AudioBuffer, error: null, status: "success" }
19.app.js:1:1871
Uncaught TypeError: e is undefined
    value http://localhost:8080/js/19.app.js:10
    value http://localhost:8080/js/19.app.js:10
    value http://localhost:8080/js/19.app.js:10
    value http://localhost:8080/js/19.app.js:10
    play http://localhost:8080/js/19.app.js:1
    n http://localhost:8080/js/app.js?ver=zdxr5612&a=1:23
    t http://localhost:8080/js/app.js?ver=zdxr5612&a=1:23

Record audio output to mediastream?

I'm wondering if it is possible to output everything to a mediastream for recording. Say, for example, were I to create a keyboard with sprites and drum samples. Could I record my audio production to a stream?

How to play sounds from imported source when run locally?

I import sound files like so:
const soundFiles = require.context('./assets/sounds', true, /\.(aac)$/i);

This creates some urls which I can pass to musquito to play, however it won't work when run locally, because of permission errors. It does work when I create an audio object passing the path, e.g. "new Audio(soundFiles[...])".

Is there a way to make musquito compatible?

loading songs into a playlist

Is it possible to load songs into a play list dynamically so that i can also add additional songs. Something like this below. Also each song that is being loaded or added to the list later would have a percentage loaded so can display to the user when its ready to play or even play all tracks at same time.

{
		"name": "Song Name 3",
		"artist": "Artist Name",
		"album": "Album Name",
		"url": "/song/url.mp3",
		"cover_art_url": "/cover/art/url.jpg",
    		"time_callbacks": {
      			1: function(){
        			console.log( "1 second into the song" )
      			},
      			90: function(){
        			console.log( "1 minute 30 seconds into the song" );
      			},
      			110: function(){
        			console.log( "1 minute 50 seconds into the song" );
      			}
    		}
	}

How to change sprite/sound done event to support callbacks?

I'm trying to tie a bunch of sounds together. I have an array of them and I want to have a callback at the end of each sound which plays the next one. It's unclear how to get a 'end' event from a single sound. How to get an event for when a sound is finished playing?

What I want to do is something like:

$buzz.play(sound1, ()=>{
   $buzz.play(sound2, ()=>{
       // etc
   })
})

I tried playEndCallback but it seems to have no effect after the sound has been created:

 sound.playEndCallback = () => {
     console.log('nope') 
 }

Preloading a bunch of files?

Hey,

Could you provide an example on how to best preload a bunch of audio files, so that there is no delay the first time they are called with $buzz.play() ?

Percent Loaded

I don't see in the docs some sample code that when loading a single mp3 or multiple sounds it would show some kind of indication or percentage loaded. Lets say you loading 3 files at once can this library load each file in sequence once the previous files is loaded.

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.