Jump to content

Position canvas on PG BABYLON.Analyser


Dad72
 Share

Recommended Posts

Hello,

If use this :

var myAnalyser = new BABYLON.Analyser(scene);
BABYLON.Engine.audioEngine.connectToAnalyser(myAnalyser);
myAnalyser.drawDebugCanvas();

The frame is not positioned in the canvas :

http://www.babylonjs-playground.com/#PTV7W#8

And this causes a bug : ( connectToAnalyser is not a function )

var myAnalyser = new BABYLON.Analyser(scene);
music.connectToAnalyser(myAnalyser);
myAnalyser.drawDebugCanvas();

http://www.babylonjs-playground.com/#PTV7W#9

 

 

Link to comment
Share on other sites

@davrous Sorry not to understand, but the first link, the analizer is position on the code editor at the top left, before I saw it position on the canvas right down. Which lets me think of a bug.

On the second link, I have an error that says: connectToAnalyser is not a function

Why are not these bugs? Is not it possible to reposition the analizer and avoid this error of connectToAnalizer is not a function ?

Link to comment
Share on other sites

@Dad72 I've explained it in the documentation: http://doc.babylonjs.com/overviews/Playing_sounds_and_music

I'm displaying the debug canvas in absolute position. It's a debug stuff, so I haven't spent much time handling the display of it. By default, it's in position: absolute, top left. You can change with the properties provided in the documentation.

The main idea of the analyser was to expose it to build experiences such as: http://babylonjs.com/Demos/Dancing CSG/ or http://babylonjs.com/Demos/AudioAnalyser/

For your second link, it's not a bug as there is no connectToAnalyser function on the BABYLON.Sound object. The function is available either on the global audio engine or on a specific sound track.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...