problems with playsound()

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by high key.

While a pure-basic program is running which uses playsound, some other programs (soundrec.exe for example) can't play sounds any more. Is there any workaround?

Compiling of program which uses playsound gives error, when NT4 compatible mode is checked.

high key => why do the important keys always hang so high...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by high key.

Found something in the meantime:

playsound_("sound.wav",0,0)

does it.

The NT4 Mode compiling problem is still there.
It seems, that the waveplaying has nothing to do with it.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> While a pure-basic program is running which uses playsound, some
> other programs (soundrec.exe for example) can't play sounds any
> more.

Do you have a half-duplex or full-duplex sound card in your PC?
A half-duplex won't let you play more than one sound source at
a time, but a full-duplex will. To test: Try playing an MP3 and
a sound with Sound Recorder at the same time -- can you hear both?
If so, then you have a full-duplex card, and therefore your problem
here may indeed be a PureBasic bug.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by high key.

Yes, I can play several soundfiles at the same time.

The playsound()-routine of purebasic is very powerful and fast for games, in normal applications it seems better to use the API-call playsound_("sound.wav",0,0)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.

It might be that purebasic reserves the sound resources exclusively and do not permit other program to access the sound resources. I'm not certain this is the case, only Fred knows and people who bother to disassemble the sound library to find out how it works.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Sound use DirectX as specified in the doc and lock the audio hardware for maximum performance. I would like to do a Sound mode for apps with the same sound lib.. Wait'n'see..

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by DemonHell.
Originally posted by PB

Do you have a half-duplex or full-duplex sound card in your PC?
A half-duplex won't let you play more than one sound source at
a time, but a full-duplex will
I thought the Full/ Half Duplex thingy was about the ability to record and play sounds at the same time? ( in the same way that half duplex network cards can`t send and recieve data at the same time, but full duplex cards can)

I had an old ISA half duplex card (might even still have it in a box in the attic) that could play multiple sounds, but couldn`t record if a sounds was playing.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> I thought the Full/ Half Duplex thingy was about the ability to
> record and play sounds at the same time?

That as well. I had a half-duplex card for years and could neither
simultaneously record and play, or play more than one source, at the
same time.
Post Reply