[Implemented] PlaySound()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Irene
Enthusiast
Enthusiast
Posts: 461
Joined: Thu Oct 04, 2007 12:41 pm

[Implemented] PlaySound()

Post by Irene »

PureBasic Help for PlaySound() wrote:0: Play the sound only once (Default value when 'Mode' is ommitted)
1: Play the sound continuously (loop). Not available under Linux!
Is there no way to implement continuous playback to PlaySound() for Linux? It is not nice to have the background music of my games stop and not play again ~_~

I made some research and by using the SDL_mixer library it should be possible to play music continuously using Mix_LoadMUS() and Mix_PlayMusic(), but with the Import and OpenLibrary() possibilities to use the SDL_mixer functions I always got a "Fatal arithmetic error" or "LINKER: Error" message from the PBCompiler T_T
dontmailme
Enthusiast
Enthusiast
Posts: 537
Joined: Wed Oct 29, 2003 10:35 am

Post by dontmailme »

I'm not sure about linux but in Windows you can use the movie commands to play sounds.....

playmovie and moviestatus to see when it's finished......

Hope I'm not too far off base here :D
Paid up PB User !
Irene
Enthusiast
Enthusiast
Posts: 461
Joined: Thu Oct 04, 2007 12:41 pm

Post by Irene »

dontmailme wrote:I'm not sure about linux but in Windows you can use the movie commands to play sounds.....

playmovie and moviestatus to see when it's finished......

Hope I'm not too far off base here :D
Sure, but as far as I know in Linux the Movie commands use the XINE library which is very inefficient and unpractical to use for music playback. And the fact that most people who use Linux simply don't use XINE but something else like MPlayer instead makes me think PureBasic should base on MPlayer than XINE (look, I know there are many who do use XINE but I'm not in that group and that's why I want to avoid using it). I might just as well use a RunProgram() to call MPlayer to play the music, but that would be even more inefficient ~_~
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

I second the request.

I'm not working on Linux atm, but if I ever would, I would need this for my game-music, too.
oh... and have a nice day.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

[Joke]Bill gates solution: don't use linux :P[/Joke]
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

I need this for my mmorpg pls
Irene
Enthusiast
Enthusiast
Posts: 461
Joined: Thu Oct 04, 2007 12:41 pm

Post by Irene »

Psychophanta wrote:[Joke]Bill gates solution: don't use linux :P[/Joke]
He already wrote a guide for the solution! http://support.microsoft.com/kb/247804 ^o^ ^_^
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Irene wrote:He already wrote a guide for the solution! http://support.microsoft.com/kb/247804 ^o^ ^_^
Nice one! LOL! :lol:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
dontmailme
Enthusiast
Enthusiast
Posts: 537
Joined: Wed Oct 29, 2003 10:35 am

Post by dontmailme »

Irene wrote:
Psychophanta wrote:[Joke]Bill gates solution: don't use linux :P[/Joke]
He already wrote a guide for the solution! http://support.microsoft.com/kb/247804 ^o^ ^_^
I guess you've already seen the reverse ?!

http://www.hinterlands.org/removewin.html
Paid up PB User !
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

The loop flag should work on the current linux beta (it has been implemented).
Irene
Enthusiast
Enthusiast
Posts: 461
Joined: Thu Oct 04, 2007 12:41 pm

Post by Irene »

Fred wrote:The loop flag should work on the current linux beta (it has been implemented).
Really nice! Thank you Frederic! ^o^
Post Reply