<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Воспроизведение одного звука из mp4]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14575&amp;type=atom" />
	<updated>2019-03-06T09:54:40Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14575</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132824#p132824" />
			<content type="html"><![CDATA[<p>Не, никакие не тестировал.<br />Но у меня без глюков работает если в таймере прописать:<br /></p><div class="codebox"><pre><code>Wmp.controls.Pause
Wmp.controls.currentPosition := 0
Wmp.controls.Play</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-03-06T09:54:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132824#p132824</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132823#p132823" />
			<content type="html"><![CDATA[<p>Да уж, работает через одно место. Знаешь какие то плееры с API и.т.п.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-06T08:32:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132823#p132823</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132822#p132822" />
			<content type="html"><![CDATA[<p>Можно запускать таймер при событии начала воспроизведения, после чего подписку на событие прекращать.<br />А таймер уже будет запускать &quot;Wmp.controls.currentPosition := 0&quot;.<br />Тебе же непрерывный цикл нужен, так что файл будет открываться только первый раз.<br /></p><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>То что в 28 последний кадр остаётся, это по твоему баг.</p></blockquote></div><p>По-моему WMP - это один большой баг. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-03-06T02:56:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132822#p132822</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132821#p132821" />
			<content type="html"><![CDATA[<p>Таймер исходя из продолжительности?<br />На коротких роликах не айс, и при открытии файла, даже картинки, WMP очень прожорлив, будут просадки. <br />Также при открытии почему то начинают перерисовываться некоторые другие окна, например блокнот++, думаю это тоже часть большой нагрузки. В других плеерах такого не наблюдал.<br />То что в 28 последний кадр остаётся, это по твоему баг.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-06T02:19:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132821#p132821</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132819#p132819" />
			<content type="html"><![CDATA[<p>Через settimer?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-03-05T19:31:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132819#p132819</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132818#p132818" />
			<content type="html"><![CDATA[<p>Так в конце не исчезает:<br /></p><div class="codebox"><pre><code>#SingleInstance Force
#NoEnv

File = w2v.mp4 

OnExit Wmpclose 
Global hWmp 

Gui, Margin, 0,0  
Gui +LastFound  +AlwaysOnTop -Caption
Gui Add, ActiveX, w111 h111 vWmp hwndhWmp, WmpLayer.OCX

ComObjConnect(Wmp, WmpEvents)

Wmp.uiMode := &quot;none&quot; 

Wmp.Url := File
Gui, Show, NA x0 y0
return   

Class WmpEvents 
{ 
	StatusChange(Wmp) { 
		If Wmp.PlayState = 3  ;	Playing
		{ 
			Height := Wmp.currentMedia.imageSourceHeight  
			Width := Wmp.currentMedia.imageSourceWidth
			winmove, ahk_id %hWmp%, , 0, 0, Width, Height 
			Gui, Show, NA w%Width% h%Height%
		}
	}    
}

esc::
Wmpclose:  
	Wmp.close
	ExitApp</code></pre></div><p>Но если изменить размер, то исчезает.<br /></p><div class="codebox"><pre><code>winmove, ahk_id %hWmp%, , 0, 0, Width, Height-1</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-05T17:05:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132818#p132818</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132817#p132817" />
			<content type="html"><![CDATA[<p>Непрерывно следить когда текущая позиция совпадёт с концом, что то не очень.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-05T16:42:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132817#p132817</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132816#p132816" />
			<content type="html"><![CDATA[<p>Отслеживай конец и перематывай сам на начало.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-03-05T16:28:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132816#p132816</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132813#p132813" />
			<content type="html"><![CDATA[<p>Точнее в момент окончания воспроизведения последний кадр пропадает (так же как и при однократном воспроизведении), то есть становится черная картинка. <br />Причём такого нет, если ActiveX в точности соответствует размерам видео, то есть по окончании воспроизведения остаётся последний кадр.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-05T15:46:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132813#p132813</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132806#p132806" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Добавьте строчку<br /></p><div class="codebox"><pre><code>Player.Settings.SetMode(&quot;loop&quot;, true)</code></pre></div></blockquote></div><p>Странный эффект, в WMP из под винды или в большинстве других плееров в момент повторного проигрывания нет мелькания как в ActiveX.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-05T13:34:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132806#p132806</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132343#p132343" />
			<content type="html"><![CDATA[<p>А GUI зачем?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-02-22T15:36:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132343#p132343</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132340#p132340" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
Gui, Add, ActiveX, vMP, WMPlayer.OCX
MP.url := file ; путь к файлу
gui, show, hide
WP.Play
</code></pre></div><p>Остановка:<br /></p><div class="codebox"><pre><code>gui, destroy</code></pre></div>]]></content>
			<author>
				<name><![CDATA[felrok]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39478</uri>
			</author>
			<updated>2019-02-22T14:43:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132340#p132340</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132215#p132215" />
			<content type="html"><![CDATA[<p>teadrinker,&nbsp; вот сейчас все заработало.<br />Большое спасибо вам.</p>]]></content>
			<author>
				<name><![CDATA[димитрий2]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39571</uri>
			</author>
			<updated>2019-02-16T10:53:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132215#p132215</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132214#p132214" />
			<content type="html"><![CDATA[<p>Попробуйте так:<br /></p><div class="codebox"><pre><code>WM_COMMAND := 0x111, ID_FILE_PAUSE := 65403, ID_FILE_CLOSE = 65405
scriptName := &quot;1.ahk ahk_class AutoHotkey&quot;
DetectHiddenWindows, On
SetTitleMatchMode 2

if !WinExist(scriptName) {
   MsgBox, Окно не найдено!
   Return
}
PostMessage, WM_COMMAND, ID_FILE_PAUSE
Sleep, 100
PostMessage, WM_COMMAND, ID_FILE_CLOSE</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-02-16T10:50:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132214#p132214</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Воспроизведение одного звука из mp4]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=132213#p132213" />
			<content type="html"><![CDATA[<p>teadrinker, теперь появилось окно &quot;Закрывающий скрипт запущен&quot;.<br />Затем пишет &quot;Окно 1.ahk обнаружено&quot;.<br />Затем пишет &quot;0&quot;.<br />Затем опять пишет &quot;0&quot; - и звук перестает проигрываться и файл 1.ahk закрывается.</p><p>А как это все - без лишних окон сделать ?<br />Просто закрыть и все.</p>]]></content>
			<author>
				<name><![CDATA[димитрий2]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39571</uri>
			</author>
			<updated>2019-02-16T10:44:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=132213#p132213</id>
		</entry>
</feed>
