Search the Community

Showing results for tags 'audio'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 189 results

  1. reapz

    Windows Phone 8 Audio

    I am trying to get audio working on Windows Phone 8. It doesn't work for me using my own code/assets or the example code/assets. My phone is a Nokia Lumia 820, has anyone had a similar issue, or is this a known issue? Here is a screenshot of the debug text from the music example.
  2. I have been working on a tile-based rogue-like exploration game that is supposed to be very relaxing and peaceful. A lot of it is procedurally generated, and I wanted to procedurally generate the music, too. So I loaded two octaves of notes in the pentatonic scale:'notec', ['../wp-content/themes/toolbox/js/assets/music/notec.ogg','../wp-content/themes/toolbox/js/assets/music/notec.mp3']);'noted', ['../wp-content/themes/toolbox/js/assets/music/noted.ogg','../wp-content/themes/toolbox/js/assets/music/noted.mp3']);'notee', ['../wp-content/themes/toolbox/js/assets/music/notee.ogg','../wp-content/themes/toolbox/js/assets/music/notee.mp3']);'noteg', ['../wp-content/themes/toolbox/js/assets/music/noteg.ogg','../wp-content/themes/toolbox/js/assets/music/noteg.mp3']);'notea', ['../wp-content/themes/toolbox/js/assets/music/notea.ogg','../wp-content/themes/toolbox/js/assets/music/notea.mp3']);'notec2', ['../wp-content/themes/toolbox/js/assets/music/notec2.ogg','../wp-content/themes/toolbox/js/assets/music/notec2.mp3']);'noted2', ['../wp-content/themes/toolbox/js/assets/music/noted2.ogg','../wp-content/themes/toolbox/js/assets/music/noted2.mp3']);'notee2', ['../wp-content/themes/toolbox/js/assets/music/notee2.ogg','../wp-content/themes/toolbox/js/assets/music/notee2.mp3']);'noteg2', ['../wp-content/themes/toolbox/js/assets/music/noteg2.ogg','../wp-content/themes/toolbox/js/assets/music/noteg2.mp3']);'notea2', ['../wp-content/themes/toolbox/js/assets/music/notea2.ogg','../wp-content/themes/toolbox/js/assets/music/notea2.mp3']);And then I called a function every time the person took a step: sound_track: function() { // random music generation if ((stepcounter % 2) == 1) { ckey ='notec'); dkey ='noted'); ekey ='notee'); gkey ='noteg'); akey ='notea'); c2key ='notec'); d2key ='noted'); e2key ='notee'); g2key ='noteg'); a2key ='notea'); ckey.volume = .3; dkey.volume = .3; ekey.volume = .3; gkey.volume = .3; akey.volume = .3; c2key.volume = .3; d2key.volume = .3; e2key.volume = .3; g2key.volume = .3; a2key.volume = .3; console.log("this part's working"); var randtime = Math.floor(Math.random()*8)+1; var randmusic = Math.floor(Math.random()*12)+1; if ((randtime == 1) || ((stepcounter % 4) == 1)) { // guaranteed beat console.log(randmusic); if (randmusic == 1 || randmusic == 11); if (randmusic == 2); if (randmusic == 3); if (randmusic == 4); if (randmusic == 5); if (randmusic == 6); if (randmusic == 7); if (randmusic == 8); if (randmusic == 9); if (randmusic == 10); } } },Which seemed to work fine! (Albeit a bit random: I need to write a few more rules, perhaps a bassline, to give the song more structure. But it's already very zen!) Anyway, this works great for the first hundred or so steps, but then the audio starts to get all staticky. Eventually, it stopped playing at all, and I had to reload the window. I thought maybe I could fix this by making the files shorter and more compressed, and I did that, and it seemed to help a bit, but the audio still got pretty corrupted-sounded and eventually stopped all-together. This affects all audio played by the code, even sound effects which have not been played more than a few times, and does not go away if I wait. I am not a programmer, and this is just a side project for me. So it's very possible that I am doing something silly, or stupid, or preposterously round-about. If so, please correct me! I have really enjoyed the experience of coding in Phaser, and it's been a lot of fun, but this kind of bug (which throws no errors in the console!) totally perplexes me, as it falls outside the realm of internal code-logic and into the realm of technical know-how, of which I have none. (If you would like to test the game out, you can find it a, and the password is trails. It's not completely finished, though, so there might be other bugs!) Also, a PS: I have lurked in these forums and used people's advice to solve a number of issues already. This seems like a great place, and you all seem like great people, and I'm excited to finally register and start contributing (even if my first contribution is a request for help!). Thank you all. EDIT: Well, I think I've figured it out! The problem was that I was doing the "ckey ='notec');" stuff (I'm not actually sure what this is called, only how it functions!) every single time the sound effects were called. This was overloading something and making the sound sound horrible. Hopefully somebody else will do the same stupid thing and this post will serve as helpful information to them!
  3. Michel (Starnut)

    Game freeze caused by audio playback

    Hey guys, has anyone encountered glitches or even complete game freezes based on audio playback with Phaser 1.1.4? I'm playing back short WAVs in the course of my game and every once in a while the game freezes up completely for half a second or so on an iPhone 4S iOS7. It's not as tremendous on an iPhone 5 with iOS7 but still glitching. Feels like a garbage collector is getting to work there. I was able to track the issue back to audio playback since no freeze appears if I turn it off. Also, I tested on my iPad1 and (apart from the fact that Safari under iOS 5.1.1 doesn't manage do actually play the sound) I could see the game slowing down every time sound playback was triggered. The whole game runs smoothly with sound playback turned off, though. Here is the code I use: // create sounds and stack themthis.sounds.push("someAudio", 1, false));// ... later in the game, play themthis.sounds[i].play('', 0, volume, false, true);Am I missing something? Is there a proper way to reuse sounds without filling up memory?
  4. away168

    Playing audio in mobile devices

    Hi guys, I'm having trouble in playing HTML5 audio in mobile devices. It appears like it doesn't want to run on autoplay, or triggered by the game code. It only works when it is directly triggered by user input (I read that from Apple that it is some security reason). My solution was to put a "ad"-like screen before getting into the game (I could replace it as my game studio name), and enable tap screen to play all the music to trigger them so they are available throughout the game. But I feel that this is too hackish and sometimes producing bug by the time I tap the screen to trigger them (which plays them all!). Any other solution? thanks!
  5. mrvinegar

    Android audio issues?

    "The audio in my game works perfectly on desktop and on Safari iPad, but on Android no audio plays, is this a known issue?" Ok, I just realized that without WebAudio I'll have this issue... Is there an example of using Audio Sprites within Phaser anywhere? I'll use that as a fall back....
  6. Hi all! Need to test audio playability on different devices, and if it's not good, I will use Web Audio - as it's supported only by ios 6.0 and later, I need to check OS version first. Here is the link: or shorten one: For that I use: navigator.appVersion,navigator.userAgent,navigator.platformThe most important is platform. Plz, write what your browser on iOS/Android and other mobile devices has for this values and your iOS/Android version. Second test is audio - it's 99% not loaded, so press on 'Try to load sounds' button and then on 'sound1', 'sound2', 'sound3'. Do the sounds can be played?
  7. * update 18/11: fixed audio bug in newer versions of Chrome that would break the game * Hey all, A couple of years ago, we (Pure Communication) made the Kaatje website: a Flash website for little kids that is linked to a live-action TV show. Now we just finished the tablet friendly HTML version, using Pixi.js! You can check it out here: Kaatje - Click here to play Here are some screenshots: [ Homescreen, with links to 4 games on top. More games will be added in the near future! ] [ Shoot those balloons, but don't shoot Eendje (Ducky)! ] [ Kaatje at the farm. Click around to discover! ] [ Reach the finish before time runs out! Avoid obstacles by clicking the red arrows, or by swiping left or right. ] [ Get those stubborn sheep in their pen! ] Our biggest problem was getting sound to work OK on most devices. In the end we used a mix of Web Audio API calls and a fallback using SoundManager 2. We'd like to thank the guys at Goodboy for their awesome Pixi.js framework and their support on Github!
  8. Hi all! I would like to add background music to an HTML5 game. I'm using GameMaker, and its audio system is quite bad, infact with last version music doesn't play even on Firefox 24 for desktop. So I'm trying to figure out by myself how it is possible to play music in Javascript in a way that works on both desktop and mobile browsers. This is my current code: /* * Plays and loops a music file. There must be the music * files in the "html5game" directory. * There must be 2 versions of the same file: a .mp3 and a .ogg. * @param file File name WITHOUT EXTENSION!*/function html5_play_music(file){ // first of all delete the audio element if already exists var audio = document.getElementById("gameMusic"); if (audio) { audio.parentNode.removeChild(audio); } // create a new audio element audio = document.createElement("audio"); audio.setAttribute("id", "gameMusic"); audio.setAttribute("autoplay", "true"); var mp3 = document.createElement("source"); mp3.setAttribute("src", "html5game/" + file + ".mp3"); mp3.setAttribute("type", "audio/mpeg"); audio.appendChild(mp3); var ogg = document.createElement("source"); ogg.setAttribute("src", "html5game" + file + ".ogg"); ogg.setAttribute("type", "audio/ogg"); audio.appendChild(ogg);}This works fine on desktop (tried Firefox, Chrome, IE10), but it does not work on mobile (tried mobile Safari, Chrome and IE10). How can I do? I see that Premium games on marketjs correctly play music on both desktop and mobile browsers: how do they do it? Thank you in advance for your help!
  9. Hi, Apologies if this has been discussed elsewhere on this forum but I couldn't see anything. I'm currently in the middle of building a browser game using HTML5 and am coming across an issue with audio (I know, there's always issues with HTML5 audio! ) I use Howler.js to handle audio sprites that contain numerous sound snippets. Howler seems great at handling the audio on mobile and definitely seems like one of the best ways of getting the consistency across devices. However I have noticed that when on a slow connection, if the user starts the game before the audio is loaded that Howler fails and doesn't play any more audio. I'm guessing this is due to the fact that the long .mp3 sprite hasn't finished loading yet. I know many people have adapted Howler.js to fit their own needs I was wondering if anybody had any good ways of checking that the mp3 is ready to be played before attempting to play it? I know you can use the 'canplaythrough' event but unfortunately this doesn't work with iOS as that requires the audio to load before the user starts interacting with the game and iOS prevents such a behaviour. Unless I'm wrong there but i know when i've tried that it doesn't seem very reliable. If anybody has any hints/tips that there happy to share it will be greatly appreciated. Thanks.
  10. I am trying to run the example "play sound 1" from Phaser 1.00TS083 Tests/audio, but it doesn't seem to work on mobile. On my iPod touch 4th gen with iOS 6.1.3, when running the example, the sound doesn't play when pressing the button and the browser crashes after a few seconds. Should this test be running on my iPod touch ?
  11. Evan Burchard

    Sweet tool for 8 bit audio Here's the SMB theme: Support for sine, square, triangle, and sawtooth. Great interface overall for people who think in terms of notes rather than sequences, loops and channels. It's this simple (via the github readme): var music = new EightBit(); music.setTimeSignature(4,4); music.setTempo(120); var piano = music.createInstrument(); piano.note('C4', 'quarter');piano.note('D4', 'quarter');piano.note('E4', 'quarter');piano.note('F4', 'quarter');
  12. mentuat

    audio performance on android

    using the fantastic howler.js - all works dandy on desktop and iOS 6 but plays like a dog on android (tab 2 android 4.1.1 chrome) using the sound sprite approach, performance is woeful - it's seemingly random if it will even play a sound and there is a noticeable lag when a sound is triggered regardless of whether it plays it or not! looks like there are plenty of reported issues with android and html5 audio around - but wondered if any of you had found a better solution/library/approach to playing sounds on android specifically when making a game.
  13. Hey all, found a nice little extension for Cocos2d-html5 to use Howler.js for easy sound sprite support on mobile. -- Tys
  14. xantherlogan

    Sound FX and Music Libraries

    Does anyone have or know of any great (and free ideally) libraries for sound effects and music for games? It's one thing to code and design a great game, but what about sound? Where do you get your effects from? Do you record your own or buy some from certain websites? Is there a specific format for games or can you use anything from mp3 to WAV? What other considerations need to be considered? Thanks in advance