Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8088

Профиль | Отправить PM | Цитировать


Сергей Красиков, не тот язык выбрали.

Например, на AutoIt:
Скрытый текст
Код: Выделить весь код
#include <Sound.au3>

AutoItSetOption("MustDeclareVars", 1)

Local $sFileName = @ScriptDir & "\Default.mp3"
Local $aSound    = _SoundOpen($sFileName)
Local $i

If @error = 2 Then
    MsgBox($MB_SYSTEMMODAL, "Error", "The file does not exist")
    Exit(1)
ElseIf @extended <> 0 Then
    Local $iExtended = @extended ; Assign because @extended will be set after DllStructCreate().
    Local $tText = DllStructCreate("char[128]")
    DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $iExtended, "struct*", $tText, "int", 128)
    MsgBox($MB_SYSTEMMODAL, "Error", "The open failed." & @CRLF & "Error Number: " & $iExtended & @CRLF & "Error Description: " & DllStructGetData($tText, 1) & @CRLF & "Please Note: The sound may still play correctly.")
	Exit(2)
EndIf

Local $iSoundLength = _SoundLength($aSound, 2)
Local $iPercent

SoundSetWaveVolume(5)
_SoundPlay($aSound)
ProgressOn($sFileName, "Volume level: ", "Current playing position: 0%", -1, -1, 16)

While 1
	For $i = 5 To 100
		SoundSetWaveVolume($i)
		$iPercent = Round(_SoundPos($aSound, 2) / $iSoundLength * 100, 1)
		ProgressSet($iPercent, "Current playing position: " & $iPercent & "%", "Volume level: " & $i & "%")
		Sleep(100)

		If _SoundPos($aSound, 2) >= $iSoundLength Then
			ExitLoop 2
		EndIf
	Next

	For $i = 100 To 5 Step -1
		SoundSetWaveVolume($i)
		$iPercent = Round(_SoundPos($aSound, 2) / $iSoundLength * 100, 1)
		ProgressSet($iPercent, "Current playing position: " & $iPercent & "%", "Volume level: " & $i & "%")
		Sleep(100)

		If _SoundPos($aSound, 2) >= $iSoundLength Then
			ExitLoop 2
		EndIf
	Next

WEnd

ProgressSet(100, "Current playing position: 100%", "Volume level: 100%")

SoundSetWaveVolume(100)
_SoundStop($aSound)
_SoundClose($aSound)

ProgressOff()

Exit(0)
Это сообщение посчитали полезным следующие участники:

Отправлено: 16:26, 05-04-2020 | #3