Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do i analyse audio from URL? #70

Open
kiRyyy opened this issue May 11, 2019 · 0 comments
Open

How do i analyse audio from URL? #70

kiRyyy opened this issue May 11, 2019 · 0 comments

Comments

@kiRyyy
Copy link

kiRyyy commented May 11, 2019

    var fs = require('fs')  
              , AudioContext = require('web-audio-api').AudioContext  
              , context = new AudioContext  

          context.outStream = process.stdout  

    fs.readFile(__dirname + '/sounds/powerpad.wav', function(err, buffer) {  
        if (err) throw err  
        context.decodeAudioData(buffer, function(audioBuffer) {  
          var bufferNode = context.createBufferSource()  
          bufferNode.connect(context.destination)  
          bufferNode.buffer = audioBuffer  
          bufferNode.loop = true  
          bufferNode.start(0)  
        })  
      })  
    } 

This code only reads from local mp3 file and I want read it from URL like: [http://streaming.radionomy.com/kiRyyy?lang=en%2cen-US%3bq%3d0.9%2cpt%3bq%3d0.8%2cpt-PT%3bq%3d0.7]

Or for another words, I want an equivalence like the follow code on my server:

    audio = new Audio();  
    audio.src = "http://streaming.radionomy.com/kiRyyy?lang=en%2cen-US%3bq%3d0.9%2cpt%3bq%3d0.8%2cpt-PT%3bq%3d0.7";  
    context = new AudioContext();  
    analyser = context.createAnalyser();  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant