<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Определение звука]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=17586</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=17586&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Определение звука».]]></description>
		<lastBuildDate>Sat, 04 Feb 2023 12:54:29 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Определение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156629#p156629</link>
			<description><![CDATA[<p><strong>__Михаил__</strong><br />Спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (baraban)]]></author>
			<pubDate>Sat, 04 Feb 2023 12:54:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156629#p156629</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Определение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156627#p156627</link>
			<description><![CDATA[<p><strong>baraban</strong> Импорт библиотеки &#039;VA.ahk&#039; в код добавить нужно. У меня она в папке &#039;Lib&#039;, поэтому проблем нет.</p><div class="codebox"><pre><code>#Include VA.ahk</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (__Михаил__)]]></author>
			<pubDate>Sat, 04 Feb 2023 02:43:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156627#p156627</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Определение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156626#p156626</link>
			<description><![CDATA[<p><strong>__Михаил__</strong><br /><span class="postimg"><img src="https://i.imgur.com/MmDeQXz.jpg" alt="https://i.imgur.com/MmDeQXz.jpg" /></span></p>]]></description>
			<author><![CDATA[null@example.com (baraban)]]></author>
			<pubDate>Fri, 03 Feb 2023 23:12:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156626#p156626</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Определение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156624#p156624</link>
			<description><![CDATA[<p><strong>baraban</strong>, Надеюсь этот код поможет понять что к чему:</p><div class="codebox"><pre><code>Wait := 500	; Таймер обновления звука.
Rou := 3	; Округление после точки.
VolMax := 0.5	; Макс. громкость.
Return


F2::	; Запуск / Остановка.
KeyWait, % A_ThisHotkey, U
If !AudioMeter{
 AudioMeter := VA_GetAudioMeter(), VA_IAudioMeterInformation_GetMeteringChannelCount(AudioMeter, ChannelCount)
 VarSetCapacity(PeakValues, ChannelCount*4)
}
SetTimer, GetPeakValues, % ((SW := !SW) = 1 ? Wait : &quot;Off&quot;)
ToolTip
ToolTip,,,,2
Return


GetPeakValues:
 SoundGet, Vol
 Vol := Round(Vol), VA_IAudioMeterInformation_GetChannelsPeakValues(AudioMeter, ChannelCount, &amp;PeakValues)
 Loop % ChannelCount{
  If ((V := Round(NumGet(PeakValues, A_Index*4-4, &quot;float&quot;), Rou)) &gt;= VolMax){
   ToolTip % &quot;Канал: &quot; A_Index &quot;, Громкость: &quot; V, 100, 0, 2
   Break
  }
  Else
   ToolTip,,,,2
 }
 ToolTip % &quot;Left:`t&quot; Round(NumGet(PeakValues, 1*4-4, &quot;float&quot;), Rou) &quot;`nRight:`t&quot; Round(NumGet(PeakValues, 2*4-4, &quot;float&quot;), Rou), 0, 0
Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (__Михаил__)]]></author>
			<pubDate>Fri, 03 Feb 2023 16:18:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156624#p156624</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Определение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156609#p156609</link>
			<description><![CDATA[<div class="codebox"><pre><code>NumGet(peakValues, A_Index*4-4, &quot;float&quot;)</code></pre></div><p>Тут вы получаете значение от 0 до 1.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 03 Feb 2023 11:42:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156609#p156609</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Определение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156608#p156608</link>
			<description><![CDATA[<p><strong>Malcev</strong><br />Я настолько камень что не знаю как это использовать</p>]]></description>
			<author><![CDATA[null@example.com (baraban)]]></author>
			<pubDate>Fri, 03 Feb 2023 11:22:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156608#p156608</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Определение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156607#p156607</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>[out] afPeakValues<br />Pointer to an array of peak sample values. The method writes the peak values for the channels into the array. The array contains one element for each channel in the stream. The peak values are numbers in the normalized range from 0.0 to 1.0.</p></blockquote></div><p><a href="https://learn.microsoft.com/en-us/windows/win32/api/endpointvolume/nf-endpointvolume-iaudiometerinformation-getchannelspeakvalues">https://learn.microsoft.com/en-us/windo … peakvalues</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 03 Feb 2023 10:35:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156607#p156607</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Определение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156604#p156604</link>
			<description><![CDATA[<p>Приветствую всех.<br />Помогите с написанием скрипта который будет срабатывать на звук. Посмотрев чутка форум нашёл очень похожий по смыслу работы, но он срабатывает на любой звук в диапазоне от 1 до 100. А нужен который будет срабатывать на более высокий диапазон (пример от 50 до 100).<br /></p><div class="codebox"><pre><code>#Include VA.ahk
#Persistent
audioMeter := VA_GetAudioMeter()
VA_IAudioMeterInformation_GetMeteringChannelCount(audioMeter, channelCount)
VarSetCapacity(peakValues, channelCount*4)
SetTimer, GetPeakValues, 100
return

GetPeakValues:
    VA_IAudioMeterInformation_GetChannelsPeakValues(audioMeter, channelCount, &amp;peakValues)
    loop %channelCount%
        if NumGet(peakValues, A_Index*4-4, &quot;float&quot;) {
            MsgBox раздался звук
            break
        }
    return</code></pre></div><br /><p>Задумка такая.<br />1. Происходит запуск скрипта<br />2. Начинается прокликивание ЛКМ с определённой частотой (20мс)<br />3. При скачке выходного звука в диапазоне от 50 до 100 происходит нажатие на Enter</p>]]></description>
			<author><![CDATA[null@example.com (baraban)]]></author>
			<pubDate>Fri, 03 Feb 2023 07:57:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156604#p156604</guid>
		</item>
	</channel>
</rss>
