Maximum sound\music size?
djbriandamage
26 Jul 2013, 12:50I'm trying to add a soundtrack to my Quest game but am having trouble. I'm using the web interface but can edit the code if necessary.
I added a script to the Game object which occurs right before the title screen displays - Play sound FILENAME file.mp3, wait for sound to finish before continuing NO, Loop YES.
If I add a tiny test WAV file here the sound successfully plays and loops throughout gameplay, even when I change rooms. This is exactly the behaviour I want. However, if I add a ~6MB MP3 file no sound ever plays even if I sit and wait at the title screen for 5 minutes. I have a bandwidth monitor which shows that nothing is being transferred.
The wiki says both WAV and MP3 files are acceptable. Are there any other restrictions that are not listed in the documentation?
Also, is there a way for me to delete these test sounds so that only my final soundtrack remains?
Thank you very much!
I added a script to the Game object which occurs right before the title screen displays - Play sound FILENAME file.mp3, wait for sound to finish before continuing NO, Loop YES.
If I add a tiny test WAV file here the sound successfully plays and loops throughout gameplay, even when I change rooms. This is exactly the behaviour I want. However, if I add a ~6MB MP3 file no sound ever plays even if I sit and wait at the title screen for 5 minutes. I have a bandwidth monitor which shows that nothing is being transferred.
The wiki says both WAV and MP3 files are acceptable. Are there any other restrictions that are not listed in the documentation?
Also, is there a way for me to delete these test sounds so that only my final soundtrack remains?
Thank you very much!
Alex
26 Jul 2013, 13:06Send me a link and I'll take a look into it.
You can't delete uploaded media files from the web interface yet, but let me know which ones to get rid of and I'll delete them for you.
You can't delete uploaded media files from the web interface yet, but let me know which ones to get rid of and I'll delete them for you.
djbriandamage
26 Jul 2013, 13:31Please delete "01 This Is Ponderous.mp3". I wanted to test a full-length song but regretted posting a commercial song. I should have chosen one that I wrote and own the copyright to.
Are you able to comment on my other issue? Is there a size or bitrate or other limitation that would prevent an MP3 file from playing and looping as I describe above?
Are you able to comment on my other issue? Is there a size or bitrate or other limitation that would prevent an MP3 file from playing and looping as I describe above?
Alex
26 Jul 2013, 13:55I'll be able to investigate the other issue when you send me a link to the game 

djbriandamage
26 Jul 2013, 16:47Here's the link to my game:
http://make.textadventures.co.uk/Play/Play.aspx?id=6424
I don't know whether you deleted the other file yet so I set it to loop the correctly-working short WAV file. When I get home from work tonight I will upload a song that I wrote and see whether the problem persists.
The song that wouldn't work was ripped from a CD at 320kbps and was about 9MB. Perhaps this exceeds a buffer or something.
http://make.textadventures.co.uk/Play/Play.aspx?id=6424
I don't know whether you deleted the other file yet so I set it to loop the correctly-working short WAV file. When I get home from work tonight I will upload a song that I wrote and see whether the problem persists.
The song that wouldn't work was ripped from a CD at 320kbps and was about 9MB. Perhaps this exceeds a buffer or something.
djbriandamage
27 Jul 2013, 05:11I uploaded one of my songs "Depression in the Big City.mp3" and configured the script but the song won't play. Then I renamed it "dprs.mp3" in case spaces in the file name might be the problem but it still doesn't work. No song plays and my bandwidth monitor shows only a few KB downloaded, unlike when I used the smaller "chimes.wav" to test and I could see it downloading on my bandwidth monitor.
djbriandamage
27 Jul 2013, 16:51I did some more testing with a very short WAV and MP3 file. The WAV file works no problem. The same song rendered as 128kbps MP3 does not play at all. I don't think I'd be doing anyone any favours by uploading a 5-minute song in WAV.
Alex
29 Jul 2013, 12:04I just did some testing and the file you've got there (test.mp3) works for me in Chrome. Which browser are you using?
djbriandamage
29 Jul 2013, 22:20I primarily use Firefox 22.0 but it doesn't work for me in Chrome 28 or IE10 either. This is on Windows 8. test.mp3 doesn't play for me with Firefox on Windows 7 either.
djbriandamage
30 Jul 2013, 22:20I just tested the game twice in Chrome. The first time I got some sort of "game not found" error. Then I refreshed a few times and it loaded my game and the song played, but it didn't loop despite the fact that I set it to loop. !?
Alex
31 Jul 2013, 10:13From what I remember, looping works in some browsers some of the time, but it's not always reliable. This is the joy of web audio unfortunately. At some point soon I'll look at integrating SoundJS http://www.createjs.com/#!/SoundJS which should fix a lot of these issues (and make some cool stuff possible like multiple sounds at once).
djbriandamage
31 Jul 2013, 11:01Thanks for looking into it. In the mean time I guess I will embed my game in a frame or something with a separate media player.
djbriandamage
10 Aug 2013, 15:31I see we can embed Javascript commands - does anyone happen to know how to play an MP3 or OGG file via Javascript? Best case scenario would be playing the song automatically, looping the music indefinitely at the end of the song, and allowing the player to play/pause or mute.
Is it perhaps possible to encapsulate the HTML5 <audio> tag in a line of Javascript? This would put the burden of playing the audio on the web browser which would make it easier on me.
If I embed this JS command under the "game" object as a "start script" would the audio persist throughout gameplay even if I change rooms?
TYVM!
Is it perhaps possible to encapsulate the HTML5 <audio> tag in a line of Javascript? This would put the burden of playing the audio on the web browser which would make it easier on me.

If I embed this JS command under the "game" object as a "start script" would the audio persist throughout gameplay even if I change rooms?
TYVM!
djbriandamage
12 Aug 2013, 14:09Oh well, embedding my game in a frame with a Soundcloud widget will have to do for now. It can autoplay but it can't loop so I'll have to figure something out.

jaynabonne
12 Aug 2013, 22:44I made an attempt at integrating SoundJS with Quest, with no luck. I set it up using preloadJS and soundJS. When I tried to load and play an mp3 file, it didn't even load. Tracing down into things, I found the capabilities for the plugin were as follows:
panning: true
volume: true
tracks: -1
mp3: false
ogg: true
mpeg: false
wav: true
m4a: false
mp4: false
aiff: false
wma: false
mid: false
Since mp3 wasn't supported, I tried switching to a wav file (which is supported), and it crashed before the file was loaded (during load?). It might have to do with the quest://local protocol and path. I've seen the same sort of crash when attempting to load a local style sheet... There may be a way to configure it to load properly, but I don't know yet what that is. It's hard to debug when it crashes and takes out the console with it...
panning: true
volume: true
tracks: -1
mp3: false
ogg: true
mpeg: false
wav: true
m4a: false
mp4: false
aiff: false
wma: false
mid: false
Since mp3 wasn't supported, I tried switching to a wav file (which is supported), and it crashed before the file was loaded (during load?). It might have to do with the quest://local protocol and path. I've seen the same sort of crash when attempting to load a local style sheet... There may be a way to configure it to load properly, but I don't know yet what that is. It's hard to debug when it crashes and takes out the console with it...
djbriandamage
14 Aug 2013, 23:48Thanks for giving it a shot, Jaynabonne. I got my SoundCloud player working which autoplays on load and has the added bonus of giving exposure to the artist so I'll probably just stick with that, but I love how Quest is turning text adventures into multimedia extravaganzas!
I'll keep an eye on this thread in case I need this for my next game.
I'll keep an eye on this thread in case I need this for my next game.