audio sprites for iOS safari and mobile

Discussion and feedback on Construct 2

Post » Wed May 30, 2012 3:21 pm

Anyone have a an audio sprites solution for C2 to make audio not so poor in iOS safari?

Ashley, you building this into C2 any time soon?

Edit by Ashley: audio sprites are no longer necessary with iOS 6, you do not need to use them any more.Ashley2012-12-11 22:20:36
B
4
Posts: 49
Reputation: 854

Post » Thu May 31, 2012 9:35 am

@faceyspacey : I did that http://www.scirra.com/forum/topic45993.html
By the way, I saw your work on making the framework work with flash(canvas) on older IE, and I also think it can help to leverage HTML5 in situation where the machines are 'old' (I'm also working with education and teachers, and the setups are really outdated).Pode2012-05-31 09:36:36
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Thu May 31, 2012 9:39 am

i'll check out your thread.

ps. im about to try SoundManager2 instead of audio.js int the IE flash canvas solution. i think it will make the audio faster.


ps. how did the Web Storage thing go for caching audio?
B
4
Posts: 49
Reputation: 854

Post » Thu May 31, 2012 12:03 pm

@faceyspacey : I cache audio in WebStorage/LocalStorage as base64 string, and it loads back perfectly ;).
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Thu May 31, 2012 12:21 pm

do you have any code to share for that? I'm about to implement your solution in the other thread? is the caching code the there cuz it didn't seem like at the time you had implemented.
B
4
Posts: 49
Reputation: 854

Post » Thu May 31, 2012 1:11 pm

@faceyspacey : I don't have any code, because I'm not using C2 for that. I have a piece of Flash applet giving me a base64 audio string, and, in my index.html page, I do a simple
[quote]
localStorage['mp3File'] = audioMP3.src;
[/quote]
to save the file (the .src being the base64 string), and I do just the opposite to load the file.
If you don't have the base64 representation of your audio file, you need to prepare it before creating your game. There are several binary <-> base64 encoders online, like there : http://www.motobit.com/util/base64-decoder-encoder.asp
Don't forget to have the right MIME type in front of your base64 string ! (Like
[quote]
"data:audio/ogg;base64,"
[/quote]
for OGG)
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Thu May 31, 2012 2:15 pm

Polyphonic audio is supported using PhoneGap, directCanvas or CocoonJS. So I would use one of them, but preferably not PhoneGap, because it's usually too slow.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Thu May 31, 2012 7:17 pm

I know about the solutions in the native wrappers. In this case, I'm actually not looking for polyphony, but simply no delays in audio playing in browsers on mobile phones, or at least in iOS safari.

It would be nice to have Pode's solution part of your C2 build process.


Pode, you available for hire? I'm on a very tight deadline of tomorrow. You want to help me with your audio sprites solution? Email me at james@faceyspacey.com. I PMed you, but I'm not sure you saw it.
B
4
Posts: 49
Reputation: 854

Post » Mon Dec 03, 2012 12:49 pm

Hello! Can you provide a cross-mobile platform play sound example? I can't save a sound in the webstorage to add offline support..

I am using C2 and Direct Canvas for Iphone/Android..

Thanks!
B
14
S
2
G
1
Posts: 10
Reputation: 1,750

Post » Mon Dec 03, 2012 3:01 pm

@dusoft - this thread is out of date, since it was posted iOS 6 has been released with support for the Web Audio API, which makes audio sprites redundant.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests