Beep в Windows 7
В Windows XP функция Beep пищала системным динамиком, но в «Семёрке» её поведение изменили, теперь звук перенаправляется на звуковую карту, что совсем не так весело.
Как выяснилось, пищать спикером всё ещё можно, но делать это придется напрямую (по ссылке пример на C#). Вот, если кому надо, то же самое, но на Delphi:
function Inp32(PortAdr: word): byte; stdcall; external 'inpout32.dll';
function Out32(PortAdr: word; Data: byte): byte; stdcall; external 'inpout32.dll';
procedure MyBeep(tone, duration: integer);
var
n,m: integer;
begin
if tone <> 0 then
begin
n := 1193180 div tone;
Out32($43,182);
Out32($42,n and $FF);
Out32($42,(n shr 8) and $FF);
m := Inp32($61);
Out32($61,m or $03);
end;
Sleep(duration);
m := Inp32($61);
Out32($61,m and $FC);
end;
Теперь пара слов об inpout32.dll. Скачать её можно отсюда, это модифицированная версия, которая, несмотря на название, работает и в x32 и в x64 редакциях Windows. Для прямого доступа к портам устанавливается драйвер, что накладывает ограничения:
- Программу в первый раз нужно запускать с правами администратора. Если планируется наличие установщика, то в конце установки можно запустить InstallDriver.exe.
- Пользователя нужно предупредить, так как многие антивирусы следят за установкой драйверов.
64-битная версия драйвера подписана, так что проблем с разрешением на установку не будет.
Комментарии
present. It's good to come across a blog every once in a while that isn't the same
old rehashed information. Fantastic read! I've saved your site and I'm including your RSS feeds to my Google account. https://slotsgeminaustralia.wordpress.com/
spelling on quite a few of your posts. Several of them are rife with
spelling problems and I in finding it very bothersome to inform the truth then again I will certainly come again again. https://w48qn.mssg.me/
webpage link on your page at appropriate place and other person will also do similar in support
of you. https://Fraza.com/news/329977-...y-dlja-kurenija
just sum it up what I submitted and say, I'm thoroughly
enjoying your blog. I as well am an aspiring blog blogger but I'm still new to the whole thing.
Do you have any tips for newbie blog writers? I'd definitely appreciate it. https://inews.in.ua/bumaga-dly...ryvaem-sekrety/
no means found any attention-grabbing article like yours.
It is beautiful price enough for me. Personally, if all site owners
and bloggers made good content as you probably did, the net will be
much more helpful than ever before. https://24.CV.Ua/izvestnyi-ukr...iya-rebrending/
of the website is very good. https://E-Times.COM.Ua/2024/11...ashhij-variant/
post at this site. https://aliana.com.ua/2025/03/...oblivim-strong/
go back the prefer?.I'm attempting to in finding things
to enhance my web site!I assume its ok to make use of some of your ideas!! https://Instukzia.com/65808-os...smoky-dogg.html
They are very convincing and can certainly work.
Nonetheless, the posts are very short for starters.
May you please lengthen them a little from next time? Thank you
for the post. https://realman.com.ua/ru/pole...ya-i-kachestvo/
more attention. I'll probably be returning to read through more, thanks
for the information! https://nexpress.com.ua/zdorov...cziya-4703.html
Stay up the good work! You already know, lots of people are hunting around for this information, you could help them greatly. https://express-News.com.ua/ri...novlyuyut-rukh/
This post posted at this web page is really fastidious. https://Newsyou.info/2025/05/p...-ta-efektivnist
to get started and set up my own. Do you require any coding knowledge
to make your own blog? Any help would be greatly appreciated! https://ravelle.com.ua/vidnovl...novogo-zhittya/
It looks like some of the text on your content are running
off the screen. Can someone else please provide feedback and
let me know if this is happening to them as well?
This might be a issue with my web browser because I've had this happen previously.
Appreciate it https://nujob.ch/companies/20bet-portugal/