How could I go about a simple way to make linux beep?
light weight out of the box code to add to a project preferred.
I have come across unfavorable solutions such as additional added files or messing with permissions with exiting system files and there is no way I want that.
perhaps a small data section that can be read or something? I am not sure.
beeps in linux
Re: beeps in linux
Okay I have found a solution I accept now that I solved the issue I was having.
I did an includebinary with a catchsound.
My issue was, that I was never hearing it before the tool exited. I did a soundstatus with while/wend and I am satisfied.
However anybody with alternate ideas feel free to chime in if you would like.
I did an includebinary with a catchsound.
My issue was, that I was never hearing it before the tool exited. I did a soundstatus with while/wend and I am satisfied.
However anybody with alternate ideas feel free to chime in if you would like.
Re: beeps in linux
I think you have found the easiest way to be honest. The built in libraries for sound/music can playback almost all kind of audio formats.
Spec: Linux Mint 20.3 Cinnamon, i7-3770K, 16GB RAM, RTX 2070 Super
Re: beeps in linux
Is WAV format all right ?
(dupplicated code)
(dupplicated code)
Code: Select all
structure wav
array w.w(21)
endStructure
initSound()
*wav.wav = allocateMemory(sizeOf(wav) )
initializeStructure(*wav, wav)
base64decoder("UklGRgAAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQ", @*wav\w(0), 40)
with *wav
wMax = 62800
reDim \w(wMax + 22)
size = (wMax + 23) * 2
PokeL(@\w(2), size - 8)
PokeL(@\w(20), size - 44)
ampli.d = 800
for i = 0 to wMax
\w(i + 22) = cos(i / (7 - sin(t.d) ) ) * ampli
ampli * 0.999
t + 0.00015
next
snd = catchSound(#pb_any, @\w(0) )
repeat
playSound(snd, #pb_sound_multiChannel)
delay(400)
until inputRequester("", "Just press enter to play", "")
endWith
Re: beeps in linux
That is rather clever. Wav works in Linux.Olli wrote: Wed Sep 20, 2023 5:16 am Is WAV format all right ?
(dupplicated code)Code: Select all
structure wav array w.w(21) endStructure initSound() *wav.wav = allocateMemory(sizeOf(wav) ) initializeStructure(*wav, wav) base64decoder("UklGRgAAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQ", @*wav\w(0), 40) with *wav wMax = 62800 reDim \w(wMax + 22) size = (wMax + 23) * 2 PokeL(@\w(2), size - 8) PokeL(@\w(20), size - 44) ampli.d = 800 for i = 0 to wMax \w(i + 22) = cos(i / (7 - sin(t.d) ) ) * ampli ampli * 0.999 t + 0.00015 next snd = catchSound(#pb_any, @\w(0) ) repeat playSound(snd, #pb_sound_multiChannel) delay(400) until inputRequester("", "Just press enter to play", "") endWith
I hear a very brief beep that I think is a pleasant sound. Very low volume though.
Thank you for this. I think I will put it into my snippet collection fiddle with it sometime and see what I can do with it.
Re: beeps in linux
I am surprised. Could you check if your volume settings are not set a little bit too light ? (<10% in ex)jeromyal wrote:[...]Very low volume though.[...]
Re: beeps in linux
Yeah I have pulse audio at 100% and all other sounds are loud and clear. I am assuming it may be the duration of the sound you generated?Olli wrote: Wed Sep 20, 2023 11:56 pmI am surprised. Could you check if your volume settings are not set a little bit too light ? (<10% in ex)jeromyal wrote:[...]Very low volume though.[...]
Re: beeps in linux
I ignore it. Normally, no problem of duration. I tested it on W10. Two things occur in my mind.
1) maybe a volume difference between Linux and Windows
2) I do not know how to compare the decibels count finally generated between Windows and Linux....
1) maybe a volume difference between Linux and Windows
2) I do not know how to compare the decibels count finally generated between Windows and Linux....