Is correct definie a public beeper and use this in all code?
when you do this:
B4X:
Dim B As Beeper
b.Initialize(1500, 650) '
b.Beep
'what to do? . sleep or delete b.relase? '
Sleep (200)
B.Release
the b.release cancel the sound. The solution is delete b.relaase, but, the B var are not relase?
may be dangerous create a lot of Beebper var and not to do release?
You can do what you want, just sleep for slightly longer then the length of the beep.
In this case Sleep(1501)
Generally It isn't 'dangerous' to not release resources. However if you create them in a loop (say 10000 steps), there might be a memory overflow.
Why don't you use one Global Beeper for all your needs. You won't have to worry about Sleep() and B.Release, there will only be one resource, which will be released when the App is killed by the OS.
I was thinking a set of different beepers with different frequencies and durations. However their number would still be relatively small and each could easily be initialized once.
[Curiosity makes me ask why not initialize multiple times, like we do with Stringbuilder? ...still learning]
any chance of getting a good code example. On all threads for the beeper, there are a lot of suggestions, but wouldn't it be nice to have a working example.. I understand that coding is a kind of goal for you but for us it is a tool to mkae the tools we need to have working........
support and code examples are the most welcome for that..
Some people even do not mind to pay a little for that, even while the software is free nowadays......I made this suggestion more times...
For every small remark, starting a new thread... Isn't that an overflow on forum threads? For searching of the topic it does not become easier.. And a topic/problem is often half solved and then people start referring to the existing topics which are always only half of the answer... Most forums like to keep it compact and more depth...
Not this one. And I don't agree about searching. No one will ever find a question that was posted in the 17th post of a thread. Anyway, this is the policy in this forum.