<?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=9873</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9873&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Воспроизведение звука из исполняемого файла».]]></description>
		<lastBuildDate>Sun, 10 Aug 2014 22:31:40 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85797#p85797</link>
			<description><![CDATA[<div class="quotebox"><cite>Странникх пишет:</cite><blockquote><p>Ваш способ ведь будет работать с другими файлами (картинками например для GUI) ?</p></blockquote></div><p>Нет, это только для wav-ресурсов, с картинками по-другому.</p><p>С помощью FileInstall:<br /></p><div class="codebox"><pre><code>ResRead(Sound, &quot;C:\Windows\Media\tada.wav&quot;) &amp;&amp; PlaySound(Sound)
Return

FileInstall, C:\Windows\Media\tada.wav, tada.wav   ; эта команда сработает только для компилятора
Return

ResRead(ByRef Data, FilePath)
{
   if !A_IsCompiled
   {
      FileGetSize, nSize, %FilePath%
      FileRead, Data, *c %FilePath%
   }
   
   else if (hMod     := DllCall(&quot;GetModuleHandle&quot;, UInt, 0, Ptr))
        &amp;&amp; (hRes     := DllCall(&quot;FindResource&quot;, Ptr, hMod, Str, FilePath, UInt, RT_RCDATA := 10, Ptr))
        &amp;&amp; (hResData := DllCall(&quot;LoadResource&quot;, Ptr, hMod, Ptr, hRes, Ptr))
        &amp;&amp; (pResData := DllCall(&quot;LockResource&quot;, Ptr, hResData, Ptr))
      VarSetCapacity(Data, nSize := DllCall(&quot;SizeofResource&quot;, Ptr, hMod, Ptr, hResData))
         , DllCall(&quot;RtlMoveMemory&quot;, Str, Data, Ptr, pResData, Ptr, nSize)
         
   Return nSize
}

PlaySound(ByRef Sound)
{
   Return DllCall(&quot;Winmm\PlaySound&quot;, Ptr, &amp;Sound, UInt, 0, UInt, SND_MEMORY := 0x4 | SND_NODEFAULT := 0x2)
}</code></pre></div><p>С помощью Ресторатора. Создать идентификатор ресурса WAVE, назвать ресурс числом (ResourceName := 123)<br /></p><div class="codebox"><pre><code>ResourceName := 123

SND_NODEFAULT := 2, SND_ASYNC := 0x1, SND_RESOURCE := 0x40004
DllCall(&quot;Winmm\PlaySound&quot;, UInt, ResourceName, Ptr, DllCall(&quot;GetModuleHandle&quot;, UInt, 0, Ptr), UInt, SND_NODEFAULT|SND_ASYNC|SND_RESOURCE)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 10 Aug 2014 22:31:40 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85797#p85797</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85738#p85738</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>Можно сначала извлечь файл .wav в папку %Temp%, а затем воспроизвести его.</p></blockquote></div><p>Wav можно проиграть и без извлечения, прямо из ресурсов. Если кому нужно, могу написать.</p></blockquote></div><p>Тоже может понадобиться, напишите, пожалуйста. Ваш способ ведь будет работать с другими файлами (картинками например для GUI) ?</p>]]></description>
			<author><![CDATA[null@example.com (Странникх)]]></author>
			<pubDate>Thu, 07 Aug 2014 13:40:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85738#p85738</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85737#p85737</link>
			<description><![CDATA[<p>Было бы неплохо.</p>]]></description>
			<author><![CDATA[null@example.com (sergeiplugatyr)]]></author>
			<pubDate>Thu, 07 Aug 2014 13:31:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85737#p85737</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85731#p85731</link>
			<description><![CDATA[<div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>Можно сначала извлечь файл .wav в папку %Temp%, а затем воспроизвести его.</p></blockquote></div><p>Wav можно проиграть и без извлечения, прямо из ресурсов. Если кому нужно, могу написать.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 07 Aug 2014 12:51:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85731#p85731</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85730#p85730</link>
			<description><![CDATA[<p><span style="color: green">Участник <strong>BashkaMen</strong> заблокирован за постоянные нарушения правил форума.</span></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 07 Aug 2014 12:50:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85730#p85730</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85722#p85722</link>
			<description><![CDATA[<div class="quotebox"><cite>BashkaMen пишет:</cite><blockquote><p>Fileinstall, путь к файлу\file.wav, %a_temp%\file.wav<br />Soundpaly, %a_temp%\file.wav</p></blockquote></div><p>Спасибо, но я уже разобрался <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Desire)]]></author>
			<pubDate>Thu, 07 Aug 2014 09:57:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85722#p85722</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85720#p85720</link>
			<description><![CDATA[<p>Fileinstall, путь к файлу\file.wav, %a_temp%\file.wav<br />Soundpaly, %a_temp%\file.wav</p>]]></description>
			<author><![CDATA[null@example.com (BashkaMen)]]></author>
			<pubDate>Thu, 07 Aug 2014 09:38:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85720#p85720</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85704#p85704</link>
			<description><![CDATA[<p>Подробности - в описании команды <em>FileInstall</em>.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Wed, 06 Aug 2014 17:31:01 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85704#p85704</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85703#p85703</link>
			<description><![CDATA[<p>Откуда извлечь и как в &quot;это&quot; засунуть файл? <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Desire)]]></author>
			<pubDate>Wed, 06 Aug 2014 16:54:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85703#p85703</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85701#p85701</link>
			<description><![CDATA[<p>Можно сначала извлечь файл .wav в папку %Temp%, а затем воспроизвести его.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Wed, 06 Aug 2014 16:13:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85701#p85701</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Воспроизведение звука из исполняемого файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85700#p85700</link>
			<description><![CDATA[<p>Здравствуйте. Интересует такой вопрос:<br />Можно ли как-нибудь засунуть .wav звук в скомпилированный скрипт, чтобы воспроизводить его оттуда?<br />Просто необходимо, чтобы файл не лежал напрямую в системе.</p>]]></description>
			<author><![CDATA[null@example.com (Desire)]]></author>
			<pubDate>Wed, 06 Aug 2014 16:04:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85700#p85700</guid>
		</item>
	</channel>
</rss>
