ninemind Posted March 20, 2014 Share Posted March 20, 2014 From what I can tell, PandaJS needs both an .ogg and .m4a file for each sound. I'm assuming that's because certain browsers/devices use one or the other. I have a bunch of .ogg files that I need to convert to .m4a. I have tried some online converters with no luck. The resulting .m4a file seems to work, but PandaJS refuses to load it. game.addSound('media/sounds/death.m4a', 'death');Uncaught Error loading: media/sounds/death.m4a audio.js:164game.Audio.game.Class.extend.loadError audio.js:164(anonymous function)core.js:586At first I thought I was just loading assets wrong, but when I use a file from one of the PandaJS examples it works fine. Is there a way to "correctly" convert these files? Quote Link to comment Share on other sites More sharing options...
angelkom Posted March 20, 2014 Share Posted March 20, 2014 http://online-audio-converter.com/ This online converter worked for me it supports batch mode too. Quote Link to comment Share on other sites More sharing options...
enpu Posted March 20, 2014 Share Posted March 20, 2014 I'm using free MediaHuman Audio Converter:http://www.mediahuman.com/audio-converter/ haden 1 Quote Link to comment Share on other sites More sharing options...
Thorsten Posted April 3, 2014 Share Posted April 3, 2014 You can use avconv with a bash script. Example on linux :#!/bin/bashfor filepath in sounds/*; do filename=$(basename "$filepath") filename="${filename%.*}" avconv -i "$filepath" -c:a libvo_aacenc -b:a 128k -y "../media/sounds/${filename}.m4a" avconv -i "$filepath" -c:a libvorbis -b:a 128k -y "../media/sounds/${filename}.ogg"donemedia=""for filepath in ../media/sounds/*.m4a; do filename=$(basename "$filepath") filename="${filename%.*}" media+="game.addAudio('sounds/$filename.m4a','$filename');"doneecho "game.module('game.media.sounds').body(function(){$media});" > ../src/game/media/sounds.js 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.