It seems like my sound plays synchronously, but some times I'd like to play them together.
Is that possible? or am I doing something wrong?
Playing sounds in parallel
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Playing sounds in parallel
What exactly do you mean? Paralell is same as synchronously to begin with, so I fail to see the point.
Re: Playing sounds in parallel
I mean:raidho36 wrote:What exactly do you mean? Paralell is same as synchronously to begin with, so I fail to see the point.
(Sounds)
^
|_[Sound 1 ]_____________________
|__________[Sound 2_____]________
|______________[Sound 3_______]__
________________________________> (time)
Sound 2 and 3 are "playing in parallel", how can I achieve that?
Re: Playing sounds in parallel
You need to create a source for each of the sounds and then you can play them parallel.
If this is not what you mean, then can you please post a .love file that shows, that you have got already?
If this is not what you mean, then can you please post a .love file that shows, that you have got already?
Check out my blog on gamedev
Re: Playing sounds in parallel
Can I play sound1 twice? because currently, it needs to stop first.micha wrote:You need to create a source for each of the sounds and then you can play them parallel.
If this is not what you mean, then can you please post a .love file that shows, that you have got already?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Playing sounds in parallel
He's saying you need to create a new source for it.
Basically, you can think of a source as a music instrument, it can only play one thing at a time.
Basically, you can think of a source as a music instrument, it can only play one thing at a time.
Re: Playing sounds in parallel
Thanks, it works.bartbes wrote:He's saying you need to create a new source for it.
Basically, you can think of a source as a music instrument, it can only play one thing at a time.
Re: Playing sounds in parallel
Will it then reuse already loaded samples?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Playing sounds in parallel
What do you mean?
If you mean whether it will use the same decoded data, then the answer is yes and no. It will if you pass it the same SoundData, it won't if you're streaming from a Decoder. The latter would also be very impractical, especially considering a streaming Source only keeps a relatively small buffer and streams from disk (or memory, I guess).
If you mean whether it will use the same decoded data, then the answer is yes and no. It will if you pass it the same SoundData, it won't if you're streaming from a Decoder. The latter would also be very impractical, especially considering a streaming Source only keeps a relatively small buffer and streams from disk (or memory, I guess).
Re: Playing sounds in parallel
Well yes, I mean decoded data, the samples. Of course I wouldn't want to play multiple streams in parallel, not under normal circuimstances, but even then not reusing samples makes perfect sense as streaming discards them almost immediately, and because of very narrow buffer frame there's no reason to even try to reuse it since that will fail, like, 99.999% of all times (that estimation might be generous actually).
That answers my question. I thought so, since LÖVE goes with the same principle as Lua about memory in general. Another minor question is must I create new sources from SoundData to reuse samples, or just passing newSource same filename will do?
That answers my question. I thought so, since LÖVE goes with the same principle as Lua about memory in general. Another minor question is must I create new sources from SoundData to reuse samples, or just passing newSource same filename will do?
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest