How to play multiple html5 audio files in iOS?
up vote
2
down vote
favorite
Let's say I have two audio files. I hooked them up with my javascript.
var audio1 = new Audio();
audio1.src = 'file1';
audio1.load();
var audio2 = new Audio();
audio2.src = 'file2';
audio2.load();
when I play audio1 then play audio2, mobile safari (ios) stops audio1 then plays audio2. It only happens with ios safari.
ios html5 audio
add a comment |
up vote
2
down vote
favorite
Let's say I have two audio files. I hooked them up with my javascript.
var audio1 = new Audio();
audio1.src = 'file1';
audio1.load();
var audio2 = new Audio();
audio2.src = 'file2';
audio2.load();
when I play audio1 then play audio2, mobile safari (ios) stops audio1 then plays audio2. It only happens with ios safari.
ios html5 audio
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Let's say I have two audio files. I hooked them up with my javascript.
var audio1 = new Audio();
audio1.src = 'file1';
audio1.load();
var audio2 = new Audio();
audio2.src = 'file2';
audio2.load();
when I play audio1 then play audio2, mobile safari (ios) stops audio1 then plays audio2. It only happens with ios safari.
ios html5 audio
Let's say I have two audio files. I hooked them up with my javascript.
var audio1 = new Audio();
audio1.src = 'file1';
audio1.load();
var audio2 = new Audio();
audio2.src = 'file2';
audio2.load();
when I play audio1 then play audio2, mobile safari (ios) stops audio1 then plays audio2. It only happens with ios safari.
ios html5 audio
ios html5 audio
asked Jan 9 '12 at 7:12
Moon
9,43658158251
9,43658158251
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
3
down vote
accepted
As far as I'm aware, this is a design decision from Apple, it'S not possible to play more than one audio file.
@lan Devlin // yes..that what I found out too..
– Moon
Jan 9 '12 at 21:39
crazy , i just use this : stackoverflow.com/questions/5194898/html5-audio-multiple-play/… I can play as much as I want audio files. I just check now , background music works with click sounds on iOS mini ipad.
– Nikola Lukic
Feb 17 '16 at 14:24
add a comment |
up vote
1
down vote
I did some testing on this recently. The short answer is as stated before, it doesn't work. I tried working with mp3,m4a(aac I purchased on itunes),mp4 and aif, so file format has no bearing on iOS safari's ability to play more than one stream at a time.
I have currently "solved" the issue in my web app by assigning priorities to sounds in the app so it can intelligently interrupt or ignore requests to play a sound file. Maybe you can try something similar.
add a comment |
up vote
0
down vote
One possible workaround is to use server-side utility like sox to mix multiple audio files into one. It is not equivalent to playing multiple audio files at random position but depending on your needs it can be a solution.
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
As far as I'm aware, this is a design decision from Apple, it'S not possible to play more than one audio file.
@lan Devlin // yes..that what I found out too..
– Moon
Jan 9 '12 at 21:39
crazy , i just use this : stackoverflow.com/questions/5194898/html5-audio-multiple-play/… I can play as much as I want audio files. I just check now , background music works with click sounds on iOS mini ipad.
– Nikola Lukic
Feb 17 '16 at 14:24
add a comment |
up vote
3
down vote
accepted
As far as I'm aware, this is a design decision from Apple, it'S not possible to play more than one audio file.
@lan Devlin // yes..that what I found out too..
– Moon
Jan 9 '12 at 21:39
crazy , i just use this : stackoverflow.com/questions/5194898/html5-audio-multiple-play/… I can play as much as I want audio files. I just check now , background music works with click sounds on iOS mini ipad.
– Nikola Lukic
Feb 17 '16 at 14:24
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
As far as I'm aware, this is a design decision from Apple, it'S not possible to play more than one audio file.
As far as I'm aware, this is a design decision from Apple, it'S not possible to play more than one audio file.
answered Jan 9 '12 at 9:01
Ian Devlin
15.8k44864
15.8k44864
@lan Devlin // yes..that what I found out too..
– Moon
Jan 9 '12 at 21:39
crazy , i just use this : stackoverflow.com/questions/5194898/html5-audio-multiple-play/… I can play as much as I want audio files. I just check now , background music works with click sounds on iOS mini ipad.
– Nikola Lukic
Feb 17 '16 at 14:24
add a comment |
@lan Devlin // yes..that what I found out too..
– Moon
Jan 9 '12 at 21:39
crazy , i just use this : stackoverflow.com/questions/5194898/html5-audio-multiple-play/… I can play as much as I want audio files. I just check now , background music works with click sounds on iOS mini ipad.
– Nikola Lukic
Feb 17 '16 at 14:24
@lan Devlin // yes..that what I found out too..
– Moon
Jan 9 '12 at 21:39
@lan Devlin // yes..that what I found out too..
– Moon
Jan 9 '12 at 21:39
crazy , i just use this : stackoverflow.com/questions/5194898/html5-audio-multiple-play/… I can play as much as I want audio files. I just check now , background music works with click sounds on iOS mini ipad.
– Nikola Lukic
Feb 17 '16 at 14:24
crazy , i just use this : stackoverflow.com/questions/5194898/html5-audio-multiple-play/… I can play as much as I want audio files. I just check now , background music works with click sounds on iOS mini ipad.
– Nikola Lukic
Feb 17 '16 at 14:24
add a comment |
up vote
1
down vote
I did some testing on this recently. The short answer is as stated before, it doesn't work. I tried working with mp3,m4a(aac I purchased on itunes),mp4 and aif, so file format has no bearing on iOS safari's ability to play more than one stream at a time.
I have currently "solved" the issue in my web app by assigning priorities to sounds in the app so it can intelligently interrupt or ignore requests to play a sound file. Maybe you can try something similar.
add a comment |
up vote
1
down vote
I did some testing on this recently. The short answer is as stated before, it doesn't work. I tried working with mp3,m4a(aac I purchased on itunes),mp4 and aif, so file format has no bearing on iOS safari's ability to play more than one stream at a time.
I have currently "solved" the issue in my web app by assigning priorities to sounds in the app so it can intelligently interrupt or ignore requests to play a sound file. Maybe you can try something similar.
add a comment |
up vote
1
down vote
up vote
1
down vote
I did some testing on this recently. The short answer is as stated before, it doesn't work. I tried working with mp3,m4a(aac I purchased on itunes),mp4 and aif, so file format has no bearing on iOS safari's ability to play more than one stream at a time.
I have currently "solved" the issue in my web app by assigning priorities to sounds in the app so it can intelligently interrupt or ignore requests to play a sound file. Maybe you can try something similar.
I did some testing on this recently. The short answer is as stated before, it doesn't work. I tried working with mp3,m4a(aac I purchased on itunes),mp4 and aif, so file format has no bearing on iOS safari's ability to play more than one stream at a time.
I have currently "solved" the issue in my web app by assigning priorities to sounds in the app so it can intelligently interrupt or ignore requests to play a sound file. Maybe you can try something similar.
answered Jan 26 '12 at 18:26
Rob Lynch
44628
44628
add a comment |
add a comment |
up vote
0
down vote
One possible workaround is to use server-side utility like sox to mix multiple audio files into one. It is not equivalent to playing multiple audio files at random position but depending on your needs it can be a solution.
add a comment |
up vote
0
down vote
One possible workaround is to use server-side utility like sox to mix multiple audio files into one. It is not equivalent to playing multiple audio files at random position but depending on your needs it can be a solution.
add a comment |
up vote
0
down vote
up vote
0
down vote
One possible workaround is to use server-side utility like sox to mix multiple audio files into one. It is not equivalent to playing multiple audio files at random position but depending on your needs it can be a solution.
One possible workaround is to use server-side utility like sox to mix multiple audio files into one. It is not equivalent to playing multiple audio files at random position but depending on your needs it can be a solution.
answered Jun 7 '12 at 1:43
David Mongeau-Petitpas
936
936
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f8785022%2fhow-to-play-multiple-html5-audio-files-in-ios%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown