![]() |
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 StatesPosts: 22 |
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 StatesPosts: 22 |
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: AustraliaPosts: 6283 |
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: AustraliaPosts: 6283 |
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: AustraliaPosts: 1882 |
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 StatesPosts: 22 |
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. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |