Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:56 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Play Sound "Off" doesn't work like manual says

Author Message
fiziwig
Newbie

Joined: 09/07/2020
Location: United States
Posts: 22
Posted: 01:26am 05 Aug 2020
Copy link to clipboard 
Print this post

Play Sound 1,B,N,200 ' starts the sound as expected, but

Play Sound 1,B,O     ' gives syntax error.

The manual says (pp74) "frequency...must be specified except when type is O."

But to actually work the frequency must be specified with type O:

Play Sound 1,B,O,1

But
 
fiziwig
Newbie

Joined: 09/07/2020
Location: United States
Posts: 22
Posted: 01:57am 05 Aug 2020
Copy link to clipboard 
Print this post

Also, this sequence of lines generates "Error: sound output in use:

play sound 1,b,n,400
play sound 1,b,o,1

play tone 500, 510 '<------ error message

So does "play sound 1,b,o,1" not actually turn the sound off internally? The sound does stop, but apparently the sound channel is not freed up.

What does work is:

play sound 1,b,n,400
play stop

But then what is "play sound 1,b,o,1" for?
Edited 2020-08-05 12:01 by fiziwig
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:14am 05 Aug 2020
Copy link to clipboard 
Print this post

  fiziwig said  
But then what is "play sound 1,b,o,1" for?

If you are using multiple sound channels, you may want to stop one channel while leaving the remaining ones playing.

PLAY STOP will stop all channels and free up the PLAY command for the next task.

Jim
VK7JH
MMedit
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:16am 05 Aug 2020
Copy link to clipboard 
Print this post

play sound 1, b, s ,440, 10
pause 2000
play sound 2, b, t ,440, 10
pause 2000
play sound 2, b, o ,440, 10
pause 2000
play stop
play tone 500,550, 2000

VK7JH
MMedit
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 02:23am 05 Aug 2020
Copy link to clipboard 
Print this post

Perhaps it means the frequency is not relevant with type O, otherwise it's a user Manual error. But agree that it appears to do exactly the same thing as Play Stop, even down to the click on restarting after setting sound O - See Edit below.

Play sound will allow changing sound parameters without closing the sound channels.

Play Tone is a different command and the user is expected to check that the existing tone (or sound if running) has finished, much like playing a sound file.

EDIT: Just got back in the shack, yes Jim is correct, sound O would be used to stop a sound number leaving others playing without shutting the complete sound sub system down.

.
Edited 2020-08-05 14:08 by KeepIS
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
fiziwig
Newbie

Joined: 09/07/2020
Location: United States
Posts: 22
Posted: 03:45pm 05 Aug 2020
Copy link to clipboard 
Print this post

  KeepIS said  Perhaps it means the frequency is not relevant with type O, otherwise it's a user Manual error. But agree that it appears to do exactly the same thing as Play Stop, even down to the click on restarting after setting sound O - See Edit below.

Play sound will allow changing sound parameters without closing the sound channels.

Play Tone is a different command and the user is expected to check that the existing tone (or sound if running) has finished, much like playing a sound file.

EDIT: Just got back in the shack, yes Jim is correct, sound O would be used to stop a sound number leaving others playing without shutting the complete sound sub system down.

.


So if I understand correctly, PLAY SOUND and PLAY TONE are mutually exclusive. I can't do a sonar ping with PLAY TONE while an explosion with PLAY SOUND is still active. Is that correct?

But I CAN play the sonar ping with PLAY SOUND using a different sound channel? I think I'm getting it now. I'll just replace instances of PLAY TONE with PLAY SOUND in my Depth Charge game project.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025