Tiny Request: Playing a sampleloop (not musicloop)

Previous topic - Next topic

spacefractal

PLAYSOUND(sfx, pan#, volume#, loop#) where loop is TRUE or FALSE. This would not break combatible at all, since loop# should only been a option of course.

Yes I are aware of SOUNDPLAYING(), but its cannot been used fora  looped sound because this require very careful timing as well. And its would also chop sometimes anyway and then cutter when lopped.

For stopping the sound, simply add a STOPSOUND(sfx) command.

Also changing panning and volume on a played sound while playing a sample would been nice, but not required.

PS. Yes you can do looped music which is very nice, the only reason is I need two looped samples (one music, and one sfx).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spicypixel

Dynamic Panning and Volume would make for a really nice gaming atmosphere :)
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

r0ber7

Quote from: spicypixel on 2012-Jan-04
Dynamic Panning and Volume would make for a really nice gaming atmosphere :)

+1  :good:

erico

It sure would be nice to have our sound system improved on a few ways.

r0ber7

Being able to adjust volume and panning while playing a sound would make me do a little dance of happy.

Gary

it would also remove the need to specify how many times to repeat the sample when loading it which I believe takes up 4 times the memory if you tell GLB to play the sample 4 times at the point of loading.

Is any of the above posts requests at all possible kitty?

Kitty Hello

I'll have a look. I wanted to either switch to SDL for windows anyway, or write my own mixer routines that would allow a lot of other messings. It's just a lot of additional work.

bigsofty

I would like to see openal used across all platforms. It would allow messing about at a lot lower level. I realise windows would need an extra DLL but it's a small price to pay for a much better API  IMHO.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Kitty Hello


Albert


aonyn

For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. -Ephesians 2:8-9

bigsofty

Quote from: Kitty Hello on 2012-Jan-09
Can I link OpenAL statically?

If its just Windows then:

Well I think, MINGW links to it statically( See http://www.nongnu.org/mingw-cross-env/#packages ), so it seems to be possible. I have not tried it, also a quick google brought up this post, http://permalink.gmane.org/gmane.comp.lib.openal/6355

Its a bit of a grey area though.

That being said, personally I don't mind making sure that the little the openal DLL is part of the final distro for my program.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

spacefractal

#12
For the tiny request I originally asked, possible to loop samples as well dymanic control volume and panning. That would works in most games really we create in this language really (including that game I create). I have a little sirene sound I want to been looped (and can been stopped at any time), but might allready have music played in background.

Its would been great to let to mix it to 22khz to save cpu as well, which could been wonderfull for those lesser powered Android devices or general. Example I use 22khz mono sound samples, so I have no need to mix to a 44khz output at all. I would do reduced very much cpu time here.

PS. OpenAL would been a great bonus for much more advanced control and could been using with new commands rather than replace them (and might limit support of devices, hence own commands here). Also if you ask me as others say, I would also not mind to include a dll file too at all. That even its should only been required for Windows 98 and XP. With OpenAL you should also been possible to support more than just PCM wav files.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Nathan

For looping sounds (only), would this help at all?

http://www.glbasic.com/forum/index.php?topic=3917.0

As I also need to loop sounds, I'm going to have a go at implementing it tonight.

spacefractal

Yes are of that, but imperfect for multiplatform use, due framerate I set might variere. Etc its cannot allways checked just in time.

not sure it's can been done in a thread, but glbasic is not thread safe.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/