davrous Posted November 5, 2015 Share Posted November 5, 2015 Hi, I’ve written an article dumping almost everything I know about Web Audio and what I’ve learned while writing the audio stack of Babylon.js: Creating fun & immersive audio experiences with Web Audio. I’m also explaining how we’ve built the Music Lounge demo being hosted on the MS Edge dev site. It also turns out to be the best up-to-date documentation on our audio stack (I'm talking about the new audio streaming feature for instance). Enjoy! Bye, David Temechon, Wingnut, iiceman and 2 others 5 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 6, 2015 Share Posted November 6, 2015 Can you update the doc too? Quote Link to comment Share on other sites More sharing options...
iiceman Posted November 6, 2015 Share Posted November 6, 2015 Sorry that I have to be that guy, but there is big mistake in that article of yours! Not sure how you could miss on such an important thing: Vaders lightsaber got the wrong color! Despite that, super cool, love the music lounge demo! adam and pog 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 6, 2015 Share Posted November 6, 2015 Agree Iiceman, this is a SHAME! Quote Link to comment Share on other sites More sharing options...
meteoritool Posted November 7, 2015 Share Posted November 7, 2015 Very interesting and cool ! I wanted a sorta solar system with each planet emitting a sound, but in a musical/rhythmically synced way, and with positional audio.Three.js worked but I didn't manage to sync audio in a simple way... Babylon.js is perfect in the way it implements Web Audio capabilities from the start, and with really easy coding.I tried but failed at writing directly with the web audio API scripting.But I was able to make things work with Babylon.js, thanks to the very good tutorials, playground and forums.Doc could be improved though it's another topic ... (for example, having a Q&A section ala 'gamefaq.com' would be nice, in the classes doc : i'd like to know default values or possible values more often given...) There is something very important I noticed :upon creating scenes with audio looping (much like in your MusicLounge example) I noticed that .mp3 sounds do NOT loop well ! There is latency between each loop ! This problem does not happen when using .wav files for sound.That is a big problem of course, as .wav files really are NOT web-friendly in terms of file size :/I don't know if this comes from Babylon.js or from the Web Audio capabilities but this is a crucial thing to know, and I haven't seen this info anywhere... I also noticed that no sound comes out using an iPad2 either with safari app or chrome app on iOS 9 ... Thanks for all the good work anyway, open source tools this quality and easy to use is a gift to the world :-) Quote Link to comment Share on other sites More sharing options...
davrous Posted November 7, 2015 Author Share Posted November 7, 2015 Thanks for the feedback! Yes, mp3 is well-known to be problematic for perfect loop.Great you like our abstraction layer on top of web audio David Quote Link to comment Share on other sites More sharing options...
meteoritool Posted November 8, 2015 Share Posted November 8, 2015 It would be a very good idea to add the simple information that .mp3 do not loop correctly in your tutorials, that would make it even more straightforward and complete ;-) ! - So is there a way to actually have sound coming out on iOS9 Safari ? - Is there gonna be any more Web Audio capabilities implemented through Babylon.js ? As an audio lover, I'd like to be able to play with reverb, delay, EQ, etc ... ? - Would you recommend Babylon.js framework if I'm gonna use Cocoon.js to turn my website into an iOS/Android/WindowsPhone app ? Quote Link to comment Share on other sites More sharing options...
davrous Posted November 8, 2015 Author Share Posted November 8, 2015 Don't know about iOS 9. The Mansion demo used to work on iPad/iPhone: http://www.babylonjs.com/index.html?MANSION Isn't it the case anymore? Yes, I'm going to add more feature. Next one will be convolver and velocity / dopler. And yes, babylonjs works great with cocoon. David Quote Link to comment Share on other sites More sharing options...
meteoritool Posted November 9, 2015 Share Posted November 9, 2015 The mansion demo runs at 9fps on my iPad2(retina) with iOS 9.1, so hard to know :/, but I can't hear anything ...This "music lounge" demo doesn't work for audio either, but I could hear sound from the Flight Simulator demo !I found those informations :https://paulbakaus.com/tutorials/html5/web-audio-on-ios/http://www.holovaty.com/writing/ios9-web-audio/Alas I'm not good enough as a dev to implement these, and I'm not sure about the problem :/ See one of my simple experiments here :http://www.orbis-somnium.com/geometric_sampler/it uses sound.attachToMesh(mesh) and actions. The position of the meshes and positional audio are used to control the volume of each sound. I still have a long way to go, with the assets loader, etc ... Quote Link to comment Share on other sites More sharing options...
davrous Posted November 9, 2015 Author Share Posted November 9, 2015 Hi, Didn't know about those bugs with iOS 9. Starting with iOS 8, their web platform starts to be a nightmare. I'll check that. For your code, can you please share it using our playground? For instance, here is a working demo of assets loader with audio files: http://www.babylonjs-playground.com/#PCY1J#8 Bye, David Quote Link to comment Share on other sites More sharing options...
davrous Posted November 9, 2015 Author Share Posted November 9, 2015 For iOS9, this demo seems to work: http://www.babylonjs-playground.com/index.html?22 if you go into the editor on the left and press the "space" virtual key on your keyboard. Conclusion: iOS9 requires a user interaction before enabling the audio context... Great... thank you Apple for not following the spec. Quote Link to comment Share on other sites More sharing options...
meteoritool Posted November 9, 2015 Share Posted November 9, 2015 For iOS9, this demo seems to work: http://www.babylonjs...m/index.html?22 if you go into the editor on the left and press the "space" virtual key on your keyboard.Yes, then a space virtual keyboard touch enables the shot sound, but no violins loop ...How can this be fixed then ? Quote Link to comment Share on other sites More sharing options...
davrous Posted November 9, 2015 Author Share Posted November 9, 2015 I need to find a hack specifically for iOS and Apple devices... Let me think about it. Quote Link to comment Share on other sites More sharing options...
meteoritool Posted November 16, 2015 Share Posted November 16, 2015 Any news regarding this issue ? I've updated the link in my previous post for the sound demo I'm making (http://www.orbis-somnium.com/geometric_sampler/) the code is a mess, now I realized i have used 2.2.0 version ...var box3 = BABYLON.Mesh.CreateCylinder("maintrigger", 2*(((3/(2*Math.sqrt(3)))*Math.sqrt(6))/3), 0, 2, 3, scene, true);And now I just see this : 2.3.0: Major updates : New Mesh.CreatePolyhedron() method I worked out my maths anyway >_< Quote Link to comment Share on other sites More sharing options...
ozRocker Posted December 8, 2015 Share Posted December 8, 2015 I'm trying to find a way to play sound on iOS 9 as well. I've seen most people will play a silent MP3 ontouchstart event, but when I'm using VirtualJoysticksCamera none of my touch events fire anymore. Quote Link to comment Share on other sites More sharing options...
davrous Posted December 8, 2015 Author Share Posted December 8, 2015 I need to work on iOS 9 issue. I've managed to find one of the only framework that seems to work on iOS 9: howler.js . I'll try to implement a similar hack. For the VirtualJoysticksCamera, it works on iPhone / iOS 9, I've just tested on our main website. You need to reference jQuery PEP polyfill. Did you reference it? Quote Link to comment Share on other sites More sharing options...
ozRocker Posted December 8, 2015 Share Posted December 8, 2015 This is the first time I've ever heard of jQuery PEP polyfill :/ Quote Link to comment Share on other sites More sharing options...
dbawel Posted December 8, 2015 Share Posted December 8, 2015 @davrous - I've not heard of jQuery PEP polyfill either. When do you recommend using this instead of hand.js, and in what circumstances would you use either - as well as does it make any sense to reference both and use conditionally? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 8, 2015 Share Posted December 8, 2015 If you are ok with hand.js please keep using it..PEP is supported by a broader community but as long as you are satisfy with hand.js stick with it Quote Link to comment Share on other sites More sharing options...
ozRocker Posted December 9, 2015 Share Posted December 9, 2015 Now I'm really confused. Davrous was suggesting I use PEP polyfill so I can detect ontouchstart events when I'm using the virtualJoystickCamera but Deltakosh says to stick with using hand.js Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 9, 2015 Share Posted December 9, 2015 both work PIck the one you want! Quote Link to comment Share on other sites More sharing options...
ozRocker Posted December 9, 2015 Share Posted December 9, 2015 ok, do you know how to detect touch events with hand.js when using the virtual joystick camera? they don't fire for me. I think the joystick camera is intercepting those events Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 10, 2015 Share Posted December 10, 2015 THis question is more for Davrous as he built the virtual joystick camera but as you can see here:https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.virtualJoystick.ts#L139 Joystick registers pointer events but is not blocking them Perhaps you should just try to hook your event on VirtualJoystick.vjCanvas as well Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.